我在許多項目中使用UIScrollViews。在升級到Xcode6之後,我使用的功能 不再工作。它根本不滾動。我在很多項目中遇到過這個問題。 我沒有使用自動佈局。UIScrollView不在Xcode6中滾動
在h文件
@property(nonatomic, retain) IBOutlet UIScrollView *scroller;
在.m文件
- (void)viewDidLoad {
[super viewDidLoad];
[scroller setScrollEnabled:YES];
[scroller setContentSize:CGSizeMake(280,940)];
}
的IBOutlet中被連接到滾動型。
嘗試在viewDidLayoutSubviews中設置內容大小 – kabarga 2014-10-06 06:56:01
在ViewDidAppear中設置內容大小後嘗試。 – 2014-10-06 12:15:31
據我瞭解,只有在使用AutoLayout時,ViewDidAppear中的setContentSize纔是必需的。不過,我之前嘗試過,沒有結果。 – Vincent 2014-10-07 07:47:01