Preventing UITableView from scrolling?

前端 未结 2 1018
既然无缘
既然无缘 2020-12-16 19:48

This seems like it\'d be a common question, so apologies if it\'s been asked before.

I\'m trying to figure out how to prevent UITableView from scrolling in my iPhone

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 20:10

    You can do that from your XIB as well as programmatically.

    From XIB:

    Just select the tableView and in Inspector uncheck bounce horizontally & bounce vertically and scroll horizontally and scroll vertically

    Programmatically:

    If you want to do that programmatically then you can try

    self.tableView.scrollEnabled = NO; 
    

    OR

    [self.tableView setScrollEnabled:NO];
    

    Hope this helps you.

提交回复
热议问题