scrollRectToVisible方法失效
- 1、使用scrollRectToVisible,CGRectMake的
宽度
和高度
都要有值 - 2、使用setContentOffset方式,比较准
- 3、再加上dispatch_after延时的方式
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//[self.scrollView scrollRectToVisible:CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT) animated:YES];
[self.scrollView setContentOffset:CGPointMake(SCREEN_WIDTH, 0) animated:YES];
});
网友评论