0

我正在尝试以编程方式调整 UIScrollView 的大小以在 iPhone 5 上调整高度,我已经通过 Storyboards 实现了这一点,但想以编程方式进行,

我已经使用以下方法来创建我的 UIScrollView 但似乎无法更改尺寸以适应 iPhone 5 是因为我最初为较小的 iPhone 设置框架尺寸?

scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(15, 80, 289, 153)];
scroll.autoresizesSubviews = YES;
scroll.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
4

1 回答 1

0

尝试这个,

scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(15, 80, 289, 153)];
scroll.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin);
于 2013-09-30T05:35:44.137 回答