1

Im trying to draw/place a view (which contains a picker view and a toolbar offscreen). On launch the View is still on the screen despite changing its coordinates in viewDidLoad.

 self.pickerViewContainer.frame = CGRectMake(0, 722, 320, 207);

Im using the storyboard. I have created the view in the storyboard, visible in the view controller. I thought i could redraw it off screen as per coordinates above.

DevC
  • 6,982
  • 9
  • 45
  • 80

1 Answers1

1

When you use Auto layout write your view's frame related code in viewDidLayoutSubviews
Here is a solution

-(void) viewDidLayoutSubviews
{
self.pickerViewContainer.frame = CGRectMake(0, 722, 320, 207);
}
Jageen
  • 6,345
  • 2
  • 37
  • 56