redraw view off screen - contains picker view and tool bar

自作多情 提交于 2019-12-11 04:52:46

问题


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.


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


来源:https://stackoverflow.com/questions/19515924/redraw-view-off-screen-contains-picker-view-and-tool-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!