开发者

Interface Bulder and XCode: change color of a view "top bar"

I have a couple of views in my iPhone app. each view shows a "top bar" in blue, I haven't added a "Navigation Bar", simply edited what's on the inspector "View Controller" section and gave it a title. (this section: http://img69.imageshack.us/i/schermata20101001a22014.png/)

Is it possible to change the color开发者_StackOverflow社区 of this bar that'a automatically added on top of other View Items? or even to hide it? both In Interface Builder or in Code, thanks.


I'm not sure how to change the one added automatically, I assume that you'll have to make your own to change things such as the color, which you can do easily with the tint option in the attributes panel.


It's the navigation bar from the UINavigationController. You can do stuff like [self.navigationController setNavigationBarHidden:YES animated:YES] and self.navigationController.navigationBar.tintColor = [UIColor magentaColor].

You should not set the navigationBar.hidden/alpha directly, since those are handled by the UINavigationController. Additionally, UINavigationController may not re-layout your views appropriately.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜