关于设置滚动条的默认值
2014-04-26 来自:permanent <?> 1 人回应

如何在每次应用返回背景时设置滚动条的默认值?

滚动条如下:

- (IBAction)slider1:(id)sender
{
    UISlider *slider = (UISlider *)sender;  //declare slider
    NSLog(@"%f",slider.value;
}

如何设置?

2014-05-09 来自:小小梦想家

添加 observerUIApplicationWillEnterForegroundNotification

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];


- (void)willEnterForeground:(NSNotification *)n {
    self.slider.value = 0.0f;
}

您的回应

你还未登陆,不能回应!登陆