我正在尝试使视图在我的应用中可滚动。
O完全按照教程https://www.youtube.com/watch?v=UnQsFlMGDsI中的步骤进行操作。
我所做的主要步骤是:
当我运行应用程序时,scrollView不起作用
I really can't make it work. I tried many ways to apply a UIScrollView and didn't get it.
As mentioned in the video, the main aim is to automatically adjust the UIScrollView
contentSize
to the size of the screen or to the size of the content in such way that on smaller devices scrolling is active and on larger devices scrolling is not active because it is not needed.
For this to achieve you've to set proper constraints to the content view so that the height is automatically calculated. From your video its visible that you're not setting the proper constraint
to the last UITextFeild
(this is important).
您必须在最后一个约束中赋予顶部和底部 约束,UITextField
以便自动计算contentView的高度。
我已经完成了一个示例项目,您可以在此处查看:
示例项目
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句