views:

509

answers:

1

first of all, i read all "changing uinavigationbar color & backgound image", but i couldnt get over my problem.

i have a tabbar app with 4 tabs. each tab has navigationcontroller. (i arranged all the objects in mainwindow.xib file in IB)

in thew first tab, i wanna display 1.jpg on navigationbars background image in first view. when the use taps the tableviews row, how can i display "2.jpg" on navigationbar for second view?

i also wanna display different images for each tabs.

how can i solve it?

thanx for all.

+2  A: 

you can do self.navigationController.navigationBar.layer.contents = (id)image.CGImage to change the navigation bar's background.

Elfred
there is no property or method after self.navigationController.navigationBar.layer.????.
tester
Yes there is, but to access it you need to include <QuartzCore/QuartzCore.h>
frenetisch applaudierend
thanks. i was seeking it for days.i hope it is not a reason for rejection ???
tester
Well, it is all using documented APIs, so if you don't exaggerate and keep the nav bar usable I see no problem in this. In fact Apple uses custom navigation bars themselves, e.g. in the Notes app on the iPad.
frenetisch applaudierend