iPhone - 内部有文本视图和表格视图的滚动视图

发布于 2024-12-20 19:06:52 字数 190 浏览 2 评论 0原文

我有一个界面,其下方有一个文本视图和一个表格视图。我当前的视图看起来像这样

UIScrollView

  • UITextView
  • UITableView

目前 TextView 和 TableView 可以垂直滚动..但我想要的是整个屏幕向上/向下滚动。为什么这不能正常工作?

I have an interface which will have a text view and a table view below it. My current view looks like this

UIScrollView

  • UITextView
  • UITableView

Currently the TextView and TableView can scroll vertically..but what i want is the whole screen to scroll up/down. Why doesn't this work properly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彡翼 2024-12-27 19:06:52

您可以将 TableView 放入 ScrollView 中,但必须在 IB 中或使用代码解决触摸、滚动和弹跳之间的冲突,并且必须使用代码设置 ScrollView 的 contentSize,而不是在 IB 中。

如果 TextView 确实“属于”表格,请考虑将其放入表格单元格中,或者更好的是,作为标题,这就是它们的用途。

You can put a TableView inside a ScrollView, but you must resolve conflicts between touches, scrolling, and bouncing in IB or with code, and you must set the ScrollView's contentSize with code, not in IB.

If the TextView really "belongs" to the table, consider putting it in a table cell, or better, as a header, that's what they're for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文