开发者

How to add a nav bar at the bottom of a view programmatically?

开发者 https://www.devze.com 2023-03-20 14:05 出处:网络
I have a view with a nav bar on top (I downloade开发者_运维技巧d this app and its a nav controller app) but how to add a nav bar on bottom?//

I have a view with a nav bar on top (I downloade开发者_运维技巧d this app and its a nav controller app) but how to add a nav bar on bottom?


//

modified

UINavigationBar *bottomBar=[[UINavigationBar alloc]initWithFrame:CGRectMake(0, 436, 320, 44)];

[self.view setFrame:CGRectMake(0, 0, 320, 460-44)];

[self.view addSubview:bottomBar];


I am pretty sure that the UINavigationController actually supports this out of the box. It's called a UIToolbar, I believe and if you look in the documentation, you'll be able to find more on that.


You can able to use the UItoolbar instead of navigation bar

     UIToolbar *toolbar = [[UIToolbar alloc] initWith:CGRectMake(0, 436, 320, 44)];

    [myview addSubview:toobar];
0

精彩评论

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