常德赵炯吧 关注:2贴子:16
  • 0回复贴,共1

ScrollView滚定时定时器无法使用的问题解决方法

只看楼主收藏回复

NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(updateUI:) userInfo:nil repeats:YES];
// 将timer加入到当前的run loop中,并将run loop mode设置为UITrackingRunLoopMode或NSRunLoopCommonModes,这样,即使用户触摸了屏幕,也不会导致timer暂停界面刷新.
[[NSRunLoop currentRunLoop] addTimer:timer forMode:UITrackingRunLoopMode];


IP属地:湖南1楼2015-12-04 12:58回复