2 for 2012 for_2012 于 2013.02.17 13:07 提问

关于设置滚动条的默认值

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

滚动条如下:

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

如何设置?

1个回答

redCoral_
redCoral_   2013.02.17 13:19
已采纳

添加 observerUIApplicationWillEnterForegroundNotification

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


- (void)willEnterForeground:(NSNotification *)n {
    self.slider.value = 0.0f;
}
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!