简体   繁体   中英

How to scroll UITableView to a certain position?

I would like to scroll my UITableView 2 cells down when clicking on a button. The total height for the shift downwards is 100px. How can I accomplish this?

设置contentOffset属性。

[aTableview setContentOffset:CGPointMake(0,100)];

swift 3版的答案:

tableView.setContentOffset(CGPoint(x: 0,y :100), animated: false)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM