I am working on very small app. In this app I am using UIrootviewController's table view to display some content in it. I want that content to be displayed at particular position so I am setting its contentInset. when I do it in viewDidLoad or in xib it is not showing any effect at first time. I have written it in shouldAutorotateToInterfaceOrientation function it is giving me proper location after orientation change but at first time it is showing table content at same location whatever may be the content insets values
here is my code for setting content insets
self.tableView.contentInset = UIEdgeInsetsMake(120, 150, 0.0, 0.0);
I have wrote this code inside viewDidLoad, and shouldAutorotateToInterfaceOrientation but it is not showing any effect when application starts. is there any other method to achieve this.
i even tried setFrame, but did not worked.
Put your code in the viewWillAppear method.