Tableview滚动反弹并隐藏底部单元格 [英] Tableview scrolling bounces back and hides the bottom cells

查看:147
本文介绍了Tableview滚动反弹并隐藏底部单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在导航控制器下显示的视图。视图顶部包含一个子视图,底部包含表视图。该表可能具有基于数据延伸超出可见高度的行。当我的行位于最后一个可见行下方时,如果我向上滚动视图,它会反弹回来,它不会停留在那里。有没有办法让它留下来?
我试图让父视图成为滚动视图,但没有帮助。我的观点来自XIB。

I have a view that is shown under a navigation controller. The view contains one subview at the top portion and a table view at the bottom. The table might have rows that extend beyond the visible height based on data. When I have rows that are below the last visible row, if I scroll the view up, it bounces back, it does not stay there. Is there a way to make it stay? I tried making the parent view a scroll view and that did not help. My view is from a XIB.

推荐答案

听起来UITableView的大小略大于iPhone屏幕上的可用区域。这可能是因为视图没有考虑到导航栏的大小。作为测试,进入Interface Builder并使UITableView更小,比如说大小的一半,这样你就可以清楚地看到顶部和底部。看看你是否仍然有相同的弹跳。

Sounds like the size of your UITableView is slightly larger than the area available on the iPhone screen. This might be because the view didn't take into account the size of hte navigation bar. As a test, go into Interface Builder and make the UITableView much smaller, say half the size, so you can clearly see the top and bottom. See if you still have the same bouncing.

如果大小正确,UITableView不需要UIScrollView按预期运行。事实上,我现在可以想到的几个原因(除了水平滚动之外),你想要在UIScrollView中使用UITableView。

If the sizes are correct, UITableView does not need a UIScrollView to function as expected. In fact, there would be few reasons, that I can think of right now (other than horizontal scroll ones), that you'd want a UITableView inside a UIScrollView.

这篇关于Tableview滚动反弹并隐藏底部单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆