gpt4 book ai didi

ios - scrollView 不快速滚动

转载 作者:行者123 更新时间:2023-11-28 13:10:49 25 4
gpt4 key购买 nike

我有一个不滚动的 ScrollView 。谷歌搜索似乎表明这可能与我的约束有关?

我的约束如下:

Trailing space to superview  = -16
Leading space to superview = -16
Top space to top layout guide = 0
Bottom space to bottom layout guide = -13

我在 viewDidLayoutSubViews 中打印出 scrollview contentSize,并且每次都打印出相同的值,即:

scrollview is (375.0, 356.5)

知道问题出在哪里

最佳答案

检查内容 View 的底部约束(ScrollView 内的容器)在您的情况下它是 UILabel

Apple Technical Note TN2154: UIScrollView And Autolayout

To size the scroll view’s frame with Auto Layout, constraints must either be explicit regarding the width and height of the scroll view, or the edges of the scroll view must be tied to views outside of its subtree.

有用的文章:Using UIScrollView with Auto Layout in iOS

关于ios - scrollView 不快速滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31379654/

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