返回navigationItem标题&背景图 [英] back navigationItem with title & background image

查看:112
本文介绍了返回navigationItem标题&背景图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何添加带图像的返回导航按钮或更改图块但我没有看到任何带有背景图像及其标题的示例( @返回) 。

I know how to add back navigation button with image or change the tile but I haven't seen any example with background image and its title (@"back").

我可以添加带有自定义背景图片和标题的自定义UIButton吗?

Can I add a custom UIButton with custom background image and title?

推荐答案

这,我最终在我的代码中所做的实际上是有效的!
只需为不同的外观更新forState和barMetrics值。

This, what I finally did in my code actually works!!! Just update "forState" and "barMetrics" values for different appearances.

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"myImage"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

这篇关于返回navigationItem标题&背景图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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