2015-06-29 118 views
0
- (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.viewUIScrollView不滚动到最后?

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); 
}