UIScrollView的自动布局问题 [英] UIScrollview Autolayout Issue

查看:162
本文介绍了UIScrollView的自动布局问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有自动布局(也许)和我的滚动视图的问题!

I have a problem with autolayout(maybe) and my scrollview!

我的问题


  1. 我向下滚动

2.然后我推到另一个View

2.Then I push to another View

3.Then我回去滚动视图看起来像这一点,我不能滚动到最高点。(我看到它在滚动视图的弹跳)

3.Then I go back and the scrollview looks like that and I'm not able to scroll to the highest point.(I see it in the bouncing of the scrollview)

任何人可以帮助我吗?

推荐答案

在包含视图控制器下面code片段也似乎解决问题,而不依赖于明确的尺寸:

The following code snippet in the containing view controller also seems to solve the problem, without relying on explicit sizes:

- (void)viewDidDisappear:(BOOL)animated {
  [super viewDidDisappear:animated];
  self.mainScrollView.contentOffset = CGPointZero;
}

它确实重置内容偏移到原点,但似乎这样做对其他的答案。

It does reset the content offset to the origin, but it seems that so do the other answers.

这篇关于UIScrollView的自动布局问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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