简体   繁体   中英

redraw view off screen - contains picker view and tool bar

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.

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);
}

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