user6092898
user6092898

Reputation:

Navigation bar not occupying entire screen

Im trying to create a UINavigationBar using storyboard but the UINavigationBar is not occupying the entire screen.

Following is the screen shot of my storyboard. enter image description here

In storyboard, it appears to occupy full screen width but in my device, the width is not full. How can I sort this out?

Upvotes: 0

Views: 298

Answers (4)

Anbu.Karthik
Anbu.Karthik

Reputation: 82766

select your viewController and go to XCode Menu - > Editor -> select Navigation Controller ,

for example

enter image description here

you get the output of

enter image description here

it works fine for any layout patterns

Upvotes: 1

user5938635
user5938635

Reputation:

firstly you have to disable size classes and auto layout in the file inspecter for your view after then set your navigation bar property like as shown in screenshot. It will be applicable for all the devices.

enter image description here

Upvotes: 1

user5917312
user5917312

Reputation:

use autoresizing selecting your NavigationBar:-

enter image description here

Upvotes: 0

Ahmet Alsan
Ahmet Alsan

Reputation: 624

1- Select your element.

2- Click triangle button at bottom right.

3- Click Add Missing Constraints

Adding missing constraints xcode 7

Upvotes: 0

Related Questions