简体   繁体   English

如何更改UINavigationBar背景图像-iPhone SDK?

[英]How to change UINavigationBar background image - iphone sdk?

first of all, i read all "changing uinavigationbar color & backgound image", but i couldnt get over my problem. 首先,我阅读了所有“不断变化的uinavigationbar颜色和背景图像”,但是我无法克服我的问题。

i have a tabbar app with 4 tabs. 我有一个带有4个标签的标签栏应用。 each tab has navigationcontroller. 每个标签都有导航控制器。 (i arranged all the objects in mainwindow.xib file in IB) (我在IB的mainwindow.xib文件中安排了所有对象)

in thew first tab, i wanna display 1.jpg on navigationbars background image in first view. 在第一个选项卡中,我想在导航栏中的背景图片中以第一个视图显示1.jpg。 when the use taps the tableviews row, how can i display "2.jpg" on navigationbar for second view? 当用户点击tableviews行时,如何在导航栏上显示“ 2.jpg”以进行第二视图?

i also wanna display different images for each tabs. 我也想为每个标签显示不同的图像。

how can i solve it? 我怎么解决呢?

thanx for all. 感谢所有人。

您可以执行self.navigationController.navigationBar.layer.contents =(id)image.CGImage来更改导航栏的背景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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