开发者

Scroll UITableView only when content doesn't fit

How can I tell a UITableView to scroll ONLY when its content doesn't fit?

I want to avoid the bouncing scroll when all rows fit int开发者_高级运维o the table view.


UITableView is a subclass of UIScrollView. UIScrollView has a property alwaysBounceVertical So try this:

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

Also look at the alwaysBounceVertical property of UIScrollView.


UITableView sets its alwaysBounceVertical property (which defaults to NO on UIScrollView) to YES by default. You can change this behavior by setting this property to NO.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜