简体   繁体   中英

Change the color & background of title in iPhone view

i have a tab bar controller as a root controller. In its first tab I have a navigation controller containing an ungrouped table view

Screenshot is at - http://sankalplabs.files.wordpress.com/2011/04/screen-shot-2011-04-05-at-11-17-10-am.png

(Since I am new to this forum, its not allowing me to upload the image)

Now i want to change the color & background of the title "Smart Analytics". I tried using a label & placing it on the title. But it has not worked. What is the way to do this ?

self.navigationController.tintColor = [UIColor greenColor];
use this

self.navigationController.navigationBar.tintColor = [UIColor greenColor];

Try with titleView property of UINavigationItem

@property(nonatomic, retain) UIView *titleView

Can be accessed like below In UIViewController inherited class.

self.navigationItem.titleView = myOwnLabel;

Related SO post

Changing the Title View of a UINavigationController UIViewController in Interface Builder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM