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 上有几个 UIView。但我无法将 self.contentScrollView 滚动到 self.childViewControllers.lastObject.view .

self.contentScrollView.contentSize不够大??

4

1 回答 1

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);
}
于 2015-06-29T04:27:01.420 回答