Navigation bar does not appear in storyboard

I am embedded in the navigation controller in the viewController, and the navigation bar item is displayed (in the path editor), and I can change the title, but the navigation bar does not appear in (path editor), and therefore I can not change the color of the hue. So I tried to add to the navigation bar programmatically, for example:

.h file

@property (strong, nonatomic) UINavigationBar *nav;

.m file

nav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
self.nav.tintColor = [UIColor blueColor];
[self.view addSubview:nav];

And here is the result:

enter image description here

Update

enter image description here

0
source share
3 answers

Do not do that. Remove this code. The navigation controller already has a navigation bar; do not add another one.

. View Controller. .

enter image description here

+1

, " , " - .

, . Storyboard , ( Simulator).

, - .

:

  • "" : UINavigationController, . , .

enter image description here

  1. . . Bar Tint, .

enter image description here

  1. . Storyboard, Simulator/Device.

enter image description here

  1. . Simulator.

enter image description here

+1

viewController, ipad iphone. viewController viewController. ( , xcode . , .) , . ( ). , , .

0

All Articles