I am using a UITableView
with UITableViewCells
and I want to stop the "over" scroll that you get at the top and bottom of the list, The bit where you can pull down on the very top cell to show the background (sometimes used to refresh) Is there anyway to just make the top edge of the cell the "absolute top"? so the view only ever shows just the cells?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Since UITableView is a subclass of UIScrollview, it should suffice to just set the 'bounces' property to NO.
Edit: you probably need to set'alwaysBounceVertical' to NO, too...
回答2:
You can set the tableview bounces property to NO.
回答3:
You can use this code to solve your Problem
self.objBackTableView.bounces = NO;
And used Below code to if data is fit on screen than its not scroll
self.objBackTableView.alwaysBounceVertical = NO;
回答4:
Swift 4.2:
It's not scroll at all:
tableView.bounces = false
It's not scroll if there is enough space for cells:
tableView.alwaysBounceVertical = false
Hope to be useful.
回答5:
Interface builder
- Select table view in Document Outline on left side
- Navigate to View Inspector on right side
- Uncheck Bounce Vertically