[英]UITableView does not show scrolling
I am populating table view in view appeared event, and calling reloadData of tableview. 我在视图出现事件中填充表视图,并调用tableview的reloadData。 Table fills up with some rows but does not show scrolling for more rows.
表填充了一些行,但没有显示更多行的滚动。 I am a fresher in iOS development.
我是iOS开发的新手。 What can be wrong?
有什么事吗
Try the following code 试试下面的代码
- (void)viewDidLoad {
//write the code to fetch and store the data in array(table view data source)
[self.tableView setFrame:self.view.bounds];//the frame should not exceed self.view.bounds, try `NSLog(@"View Bounds %@",NSStringFromCGRect(self.view.bounds));` to know view bounds
[self.tableView setScrollEnabled:YES];
[self.tableView setShowsHorizontalScrollIndicator:YES];
[self.tableView setShowsVerticalScrollIndicator:YES];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
}
replace self.tableView
with your table name. 用您的表名替换
self.tableView
。
Hope this helps. 希望这可以帮助。
尝试将tableView的框架设置为与View一样多
您是否尝试过scrollEnabled属性?
tableViewName.scrollEnabled = true
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.