[self.tableView setContentOffset:CGPointMake(0,48) animated:NO];
I have a UITableView that has a a UIView in the header. My UITableView won’t scroll to (0,48) unless animated: YES. I don’t want it to animate.
Anyone know whats up?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To set the UIView for the section header, you’re using function:
I suspect you invoke setContentOffset somewhere in viewWillAppear, but that function is called later. And I think it overwrites your contentOffset. …not sure why it doesn’t when animated is YES, but anyway, just put your setContentOffset into this function like this:
Worked for me, hope so will for somebody else.