0
我試圖調整一個UIScrollView編程方式來調整高度時,在iPhone 5,我已經通過了故事板實現了這一點,但想以編程方式做到這一點,的UIScrollView Autoresizingmask編程
我用做了以下創建我的UIScrollView,但似乎無法改變大小,以適應iPhone 5是否因爲我最初設置較小的iPhone的框架大小?
scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(15, 80, 289, 153)];
scroll.autoresizesSubviews = YES;
scroll.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
嘗試,scroll.autoresizingMask =(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin); – karthika