开发者

Statusbar overlaps ViewController

开发者 https://www.devze.com 2022-12-17 17:11 出处:网络
When I open some other view controller from my main view controller, the some other view controller gets opened with no issues. But when I dismiss other view controller and coming back to my view cont

When I open some other view controller from my main view controller, the some other view controller gets opened with no issues. But when I dismiss other view controller and coming back to my view controller, the status bar overlaps my main view controller.

Size of our view is 460 and 20 pixels for status bar is given.

Similar question is already posted in stack overflow, there is an answer to that question which says "The solution was to load the UIViewController in the old UINavigationViewController. This way the UIViewController keeps its former position.". But we are not using UINavigationViewController. Can any one please tell us how else we开发者_JS百科 can solve this issue.


If your main view controller is created in Interface Builder, go check the Inspector window and make sure that "wants full screen" is not enabled. Do the same for any other view controllers.

I haven't personally encountered this, but if you're flipping views around you probably want to do what UITabViewController and UINavigationController do and create one view that serves as a container for other views that you switch between.

Sometimes which "simulated user interface elements" you have enabled for a view will affect the placement of the view, so make sure that the simulated UI elements for all views match what you would actually be looking at when the view is shown.

If you're not using presentModalViewController to show "some other view" then give that a try.

0

精彩评论

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