Sheehan Alam
Sheehan Alam

Reputation: 60859

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?

Upvotes: 9

Views: 7876

Answers (3)

Ashwin Felix
Ashwin Felix

Reputation: 213

swift 3 version of the answer:

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

Upvotes: 4

Tom Irving
Tom Irving

Reputation: 10059

Set the contentOffset property.

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

Upvotes: 14

Related Questions