开发者

UINavigationItem on the UINavigationController

开发者 https://www.devze.com 2023-03-08 03:34 出处:网络
So I created a UINavigationBar and set it up as an outlet in the .h and .m files. I also connected them in the interfa开发者_开发技巧ce builder. It is working fine.

So I created a UINavigationBar and set it up as an outlet in the .h and .m files. I also connected them in the interfa开发者_开发技巧ce builder. It is working fine.

I need to set a label to the Navigation Bar, and I understand that I need to setup an UINavigationItem for this work. I had setup outlets for the UINavigationItem and connected them via the user interface. It is not appearing when I build and run it.

Am I missing something ? Or do I just need to create an UILabel and place it over the Navigation Bar ?


Try using the navigation item's title property for this:

UINavigationItem *item = [[[UINavigationItem alloc] initWithTitle:@"Login"] autorelease];
[yourNavigationBar pushNavigationItem:item animated:NO];
0

精彩评论

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