Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

full screen background image while using uinavigationcontroller

I have an UINavigationController with UINavigationBar hidden = YES.

I want full screen bg for view that embedded in UINavigationController.

But I get only that: http://cs616618.vk.me/v616618797/1bf0d/FEdIn0Nn4x8.jpg

Is it possible to make it full screen under status bar? I achieved that with standalone view controller, but while using it in UINavigationController it becomes like on image.

like image 884
Roman F Avatar asked Feb 23 '26 07:02

Roman F


1 Answers

Check that all your view controllers are correctly configured:

The UINavigationController:

<code>UINavigationController</code> configuration

The rootViewController (inside the UINavigationController):

<code>UIViewController</code> configuration

Here's the result I get using the above configuration and an "Aspect fill" setting on the UIImageView:

Full screen image behind status bar

If you want to do this programmatically, try this:

In your view controller's code:

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

And where you're initializing your UINavigationController (AppDelegate, etc.):

navController.edgesForExtendedLayout = UIRectEdgeAll;

Of course, do not forget to comment or remove all lines of code that could interfere with these settings.

like image 103
Romain Avatar answered Feb 24 '26 22:02

Romain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!