如何使ScrollView全屏?我放置了必要的约束,但这没有工作
我正在尝试制作一个 ScrollView ,以便其大小适应文本的大小。我放置了所有必要的约束
,但是当应用程序显示在模拟器上时,内容视图从安全区,也最终到达安全区。尽管我已将滚动视图固定到超级视图,并将内容视图固定到滚动视图。
我希望内容不是从安全区域开始,如这里 ,
而是从屏幕开头开始这里
换句话说,我想删除顶部和底部的蓝色条
您有什么想法吗?
I'm trying to make a ScrollView so that its size adjusts to the size of the text. I placed all the necessary constraints
, but when the application is displayed on the simulator, the content view starts from the safe area and also ends up to the safe area. Although I have pinned scroll view to superview and content view to scroll view.
I want the content to start not from the safe area like here ,
but from the start of the screen like here
in other words, I want to remove the blue bar from the top and bottom
Do you have any ideas how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有时 UITableView &即使您将视图附加到超级视图的顶部,UIScrollView 仍然可以显示安全区域。您只需要添加一行即可解决此问题,但请确保您的 ScrollView 连接到 superView 而不是顶部的安全区域。
将scrollView添加到您的ViewController并在viewDidLoad()中只需编写:
检查此答案以获取更多详细信息: Make UITableView忽略安全区域
Sometimes UITableView & UIScrollView can still show safe area even though you attach your View to top of Super View. You just need to add one line to solve this issue but make sure your ScrollView is connected to superView not safe area at the top.
Add scrollView to your ViewController and in viewDidLoad() just write:
Check this answer for further details: Make UITableView ignore Safe Area