gpt4 book ai didi

ios - UIScrollView 里面的 UIVIew 弹回来

转载 作者:可可西里 更新时间:2023-11-01 17:09:44 26 4
gpt4 key购买 nike

我的应用程序适用于 iPad,使用带有两个场景的 Storyboard。在一个场景中,我有一个包含 UIVIew 的 UIScrollView。它滚动,但立即弹回,使自己变得无用。 UIScrollView 的大小为 768x590; UIView 的大小为 768x1590; UIScrollView 的 ContentSize 是 768x590。这是 UIScrollView 设置的图像: enter image description here

(在过去的 6 个小时里,我查看了 SO 和 Google,尝试了很多东西,但没有任何效果。我也做了几次 CMD + Option + K(Clean),但这也没有帮助.

为什么不能正常滚动?

最佳答案

找到适合我的方法!

When you embed a view into a UIScrollView in InterfaceBuilder, then there's a constraint automatically set. If your view is "longer" than the screen in portrait, it wont scroll at all.

But if you rotate the screen, you'll notice the ability to scroll a little.

To get UIScrollView going in AutoLayout look into your constraints.

Find "Vertical Space - Scroll View - View" and set it from "constant" to "auto" - fixed everything for me.

感谢您的帮助...非常感谢。

关于ios - UIScrollView 里面的 UIVIew 弹回来,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13317829/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com