[英]iOS- ScrollView not working with Auto Layout
I am trying to add scroll view with AutoLayout. 我正在尝试使用AutoLayout添加滚动视图。 But ScrollView not working. 但是ScrollView无法正常工作。 Here I attached screen shot. 在这里,我附上了屏幕截图。
scrollView.contentSize = CGSizeMake(self.view.window.frame.size.width, 530);
设置您的scrollView ContentSize。
Pin your scroll view's leading, trailing, top and bottom space to the superview in your storyboard 将滚动视图的前导,尾随,顶部和底部空间固定到情节提要中的超级视图
Try setting scrollView contentSize
in -(void) viewDidLayoutSubviews
method. 尝试在-(void) viewDidLayoutSubviews
方法中设置scrollView contentSize
。 This method invokes after autolayout is done. 自动布局完成后调用此方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.