如何更改backBarButtonItem的颜色? [英] how to change the color of backBarButtonItem?

查看:166
本文介绍了如何更改backBarButtonItem的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我想更改bacBarButtonItem的颜色. 可以改变颜色吗?否则我必须贴上图片. 如果有图片,请告诉我代码如何放置图片.

In my application I want to change the color of bacBarButtonItem. Is it possible to change the color? or I have to put an image of it. and in case of image tell me the code how to put the image.

推荐答案

UIImage *image = [UIImage imageNamed:@"imageName.png"];
UIBarButtonItem* backBarButton = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(backButtonAction)];
self.navigationItem.leftBarButtonItem=backBarButton;
[backBarButton release];

这篇关于如何更改backBarButtonItem的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆