OGeek|极客世界-中国程序员成长平台

标题: ios - 即使 UIView 框架增加,UIScrollview 也不会滚动到 UIView 高度之外 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 10:27
标题: ios - 即使 UIView 框架增加,UIScrollview 也不会滚动到 UIView 高度之外

我正在尝试创建一个需要在 iphone 3.5 英寸屏幕中滚动的屏幕。我附上了包含 uiviewcontroller 、 uiscrollview 、 uiview 配置的图像。问题是尽管高度似乎增加了,但当我运行 iPhone 4s 时,滚动的某些部分隐藏在 UIView 之外(尽管当我在控制台中打印高度时 uiview 高度显示为 700)。可能是什么问题?请帮我 ? enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here



Best Answer-推荐答案


您有具有负值的约束。在最后一个屏幕截图中,我假设它是来自 scrollView 内部 View 的约束,到 super View 的底部偏移量是 -400。

我认为这就是为什么您看不到整个 View 的原因,因为底部偏移量是负数。尝试将此值设置为 0,这应该可以解决它。

如果这不能解决您的问题,也许您可​​以指定图像中的约束是针对哪个 View 。

告诉我进展如何!祝你好运!

关于ios - 即使 UIView 框架增加,UIScrollview 也不会滚动到 UIView 高度之外,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29267627/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4