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.
精彩评论