scrollview xcode4.5 autolayout [英] scrollview xcode4.5 autolayout
问题描述
- (void)viewDidLoad
{
-(void)viewDidLoad {
[scroller setScrollerEnabled:YES];
[scroller setContentSize:CGSizeMake(100,1000)];
[scroller setScrollerEnabled:YES]; [scroller setContentSize:CGSizeMake(100, 1000)];
[super viewDidLoad];
[super viewDidLoad];
在检查自动布局之前100%工作,当我检查自动布局并添加imagesView,按钮等更多滚动不再工作,如果我删除autolayout再次正常工作
work 100% before check auto layout when i check auto layout and add a imagesView,button and more the scroll is dosen't work any more, if I remove autolayout is work good again
推荐答案
加载视图后我理解autolayout设置约束,所以问题可能是你在viewDidLoad上设置了约束,就在autolayout改变之后。
尝试在viewDidAppear上设置此约束。
To my understanding "autolayout" set constraint after loading the view so the problem could be that you set your constrains on viewDidLoad and just after that "autolayout" changes that. Try to set this constrains on viewDidAppear.
这篇关于scrollview xcode4.5 autolayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!