- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
CGFloat w = self.contentScrollView.bounds.size.width;
CGFloat contentoffSetx = self.childViewControllers.count * w;
self.contentScrollView.contentSize = CGSizeMake(contentoffSetx, 0);
}
我在self.contentScrollView上有一些UIViews。但我无法将self.contentScrollView滚动到self.childViewControllers.lastObject.view
。
self.contentScrollView.contentSize
不够大?
答案 0 :(得分:0)
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
CGFloat w = [UIScreen mainScreen].bounds.size.width;
CGFloat contentoffSetx = self.childViewControllers.count * w;
self.contentScrollView.contentSize = CGSizeMake(contentoffSetx, 0);
}