ScrollView仅在视图第二次出现时才开始滚动 [英] ScrollView start scroll only second time that the view appear

查看:73
本文介绍了ScrollView仅在视图第二次出现时才开始滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用自动布局的iOS7中的视图存在问题.

I've a problem with my view in iOS7 with autolayout.

这是我的结构:

UITextView 的内容是动态的,因此我将他的 contentSize 动态地适合在 viewDidLoad 中.

The UITextView content is dynamic so I fit his contentSize dynamically in the viewDidLoad.

在我的 viewDidAppear 中,我尝试拟合MainScroll的 contentSize 和由 UIScrollView 高度之和(小一),Pager高度和 UITextView 高度.我记录了这个高度,它返回了正确的大小:1300px,但是视图没有滚动.

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. I logged this height and it returned the correct size: 1300px but the view doesn't scroll.

如果我更改选项卡并返回到此处,则滚动开始滚动,我试图将每段代码都放在 viewDidLoad 中,但是它不起作用.

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.

你能帮我吗?

对不起,英语不好.

推荐答案

尝试选择它,然后在情节提要中选择重置为建议的约束".:).

Try selecting it and then selecting "reset to suggested constraints" in the storyboard. :).

这篇关于ScrollView仅在视图第二次出现时才开始滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆