开发者

iPhone - Transparent status bar does not resize subviews

开发者 https://www.devze.com 2022-12-15 05:57 出处:网络
I have two viewcontrollers in my app, one of them shows an opaque status bar (default) while the other shows a black translucent status bar.

I have two viewcontrollers in my app, one of them shows an opaque status bar (default) while the other shows a black translucent status bar.

When I come from the first view controller to the other, in viewWillDisappear of controller1, I specify this

[[UIApplication sharedApplication] setStatus开发者_运维百科BarStyle:UIStatusBarStyleBlackTranslucent animated:YES];

The autoresizing mask of controller2 is set as follows

self.view.autoresizesSubviews = YES;
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

But even then, when controller2's view appears, the view begins from right below the status bar. I see a white space below the status bar. When the status bar is hidden after 3 seconds, the view adjusts and covers the white space. When the view is again tapped to show the status bar, the view shifts down to leave white space below the status bar.

Can someone please let me know how to resolve this.

Thanks.

More Info

This is only a problem with 3.x. With 2.2.1 the same code works fine and the view starts from behind the status bar.

Adding images to show what I mean alt text http://img64.imageshack.us/img64/4008/withstatus.png

alt text http://img63.imageshack.us/img63/6281/withoutstatus.png


Do you need to autoresize the view ? Can you not just set its frame to full screen ? That would force it under the bar.

0

精彩评论

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