简体   繁体   English

ScrollView仅在视图第二次出现时才开始滚动

[英]ScrollView start scroll only second time that the view appear

I've a problem with my view in iOS7 with autolayout. 我在使用自动布局的iOS7中查看时遇到问题。

This is my structure: 这是我的结构: 在此处输入图片说明

The UITextView content is dynamic so I fit his contentSize dynamically in the viewDidLoad . UITextView内容是动态的,因此我将其contentSize动态地适合在viewDidLoad

In my viewDidAppear I try to fit the contentSize of the MainScroll and the mother view calculated by the sum of UIScrollView height (the little one), Pager height and UITextView height. 在我的viewDidAppear我尝试拟合MainScroll的contentSize和由UIScrollView高度(小),Pager高度和UITextView高度之和计算的母视图。 I logged this height and it returned the correct size: 1300px but the view doesn't scroll. 我记录了这个高度,它返回了正确的大小:1300px,但视图没有滚动。

If I change tab and return here the scroll start to scroll, I've tried to put every piece of code in the viewDidLoad but it doesn't work. 如果我更改选项卡并返回到此处,则滚动开始滚动,我试图将每段代码都放入viewDidLoad但是它不起作用。

Can you help me? 你能帮助我吗?

Thanks and sorry for bad English. 谢谢,抱歉英语不好。

Try selecting it and then selecting "reset to suggested constraints" in the storyboard. 尝试选择它,然后在情节提要中选择“重置为建议的约束”。 :). :)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM