当再次出现视图时,RightBarButtonItem消失 [英] RightBarButtonItem disappears when view appears again

查看:54
本文介绍了当再次出现视图时,RightBarButtonItem消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我的NavigationItem中的RightBarButtonItem在视图第二次出现后消失了.第一次加载视图时,它会正确显示,但是第二次完全消失.

My problem is that my RightBarButtonItem, in my navigationItem, disappears after the view appears a second time. The first time the view loads, it displays properly, but the second time it disappears completely.

该按钮在viewWillAppear中的初始化如下:

The button is init'd in viewWillAppear as such:

UIBarButtonItem *optionsButton = [[UIBarButtonItem alloc] initWithCustomView:roundedButton];
self.navigationItem.rightBarButtonItem = optionsButton;

我记得叫超级

我只再次触摸导航控制器:

I only touch my navigation controller once more:

http://pastebin.com/udviCe0Y

有什么想法可能会发生这种情况吗?

Any ideas how this might be happening?

推荐答案

您可以使用类别在导航栏上添加自定义图像.通过在导航栏上创建类别来覆盖drawRect方法.在Google上搜索,您会找到它.如果没有让我知道.我帮你做.

you can use a category to add custom image on navigation bar. Override drawRect method by creating a category on navigation bar. Search on google you will find it. If not let me know. I'll do it for you.

这篇关于当再次出现视图时,RightBarButtonItem消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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