iphone - 仅当内容不适合时才滚动 UITableView

标签 iphone uitableview

如何告诉 UITableView 仅在其内容不适合时才滚动?

当所有行都适合表格 View 时,我想避免弹跳滚动。

最佳答案

UITableView 是 UIScrollView 的子类。 UIScrollView有一个属性alwaysBounceVertical 所以试试这个:

    MyTableView.scrollEnabled =  Table_rowcount * rowheight > tableview.frame.size.height;

另请查看 UIScrollView 的alwaysBounceVertical 属性。

关于iphone - 仅当内容不适合时才滚动 UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5489755/

相关文章:

ios - 适用于 iPhone 的真实表格组件

iphone - UITableView Header(不是section header)问题

iphone - 我无法使用这个简单的 LLDB 别名

ios - 如何在 iphone 中获取单元值?

ios - 选择 estimatedHeight 与 rowHeight 不同的项目时,iOS8 中的 UITableView 错误

ios - 在 UiTableViewCell 上设置时,DisclosureButton Indicator 或 Any kind of Accessory Type 似乎没有出现

iphone - PopOver 在 Leftside up+iphone 中打开

iphone - 以编程方式创建 View 时不会调用 ViewWillAppear/Disappear

ios - 在 iPhone ARM64 调用约定中,寄存器 $x1 中的内容是什么?

iphone - 如何调整 UITableView 的大小以自定义动态扩展 UITableViewCell