开发者

How can I resize UIviewController's view?

开发者 https://www.devze.com 2023-03-23 03:02 出处:网络
I have a customView on main window, so I want my Viewcontroller\'s view to resize so that it doesn\'t overlaps with the custom view on main window.

I have a customView on main window, so I want my Viewcontroller's view to resize so that it doesn't overlaps with the custom view on main window.

I tried setting frame property of my VC's view in the viewDidLoad method but it automatically resizes to full window height.

self.view setFrame: CGRectMake(0,0, 320, 200);

But when my view is loaded/appears it resizes it to full window height (tha开发者_开发问答t is 480px).

Am I trying to do something which is not possible?


UIView *loadingView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 200.0)];
loadingView.backgroundColor = [UIColor darkGrayColor];  //optional For You
[window addSubview:loadingView];

Try this, I Hope you will get your solution.


try myViewController.view addSubview:self.window after setting the frame property.

And try to make the mainwindow programmatically to have more control over it.

hope it helps..

0

精彩评论

暂无评论...
验证码 换一张
取 消