How to set topBar and bottomBar UIView program parameters?

There are several parameters in the interface builder for UIView UIViewController: topBar, bottomBar, ...

enter image description here view interface linker options

What happens when I set the value of the navigation bar for the Top Bar parameter, and the tab bar for the lower bar parameter? This is very useful for me.

So how can I do this programmatically?

+5
source share
1 answer

In fact, these parameters are used to build the correct interface, and even if you set these stripes in the Xcode Interface Builder, they will not appear unless you use the UIViewController inside some UIViewController containers.

, UIVIewController UINavigationController, . , , UIViewController .

UIViewController, . :

UINavigationBar *yourBar = [[UINavigationBar alloc] init];
[self.view addSubview:yourBar];
+1

All Articles