在我看来控制器的viewDidLoad
功能,我有这个人:
UIScrollView *scroller = [[UIScrollView alloc] initWithFrame:self.view.frame];
scroller.contentSize = self.view.frame.size; // Tried w/ and w/o this
scroller.showsVerticalScrollIndicator = YES; // Tried w/ and w/o this
for (int x = 0; x < 10; x++) {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, x * 100, 100, 100)];
label.text = [NSString stringWithFormat:@"%i label", x];
[scroller addSubview:label];
}
[self.view addSubview:scroller];
它显示前 8 个标签 OK,但滚动视图不会...滚动。它只是被切断了。知道为什么吗?