在iOS 7中看不到后退按钮 [英] Back button is not visible in iOS 7
问题描述
我对iOS 7有一些奇怪的麻烦。我的应用程序中有一个 UINavigationBar
,它适用于iOS 6;
I have some weird trouble about iOS 7. I have an UINavigationBar
in my app and it works perfect for iOS 6;
- IOS 6 -
然而,当我尝试在iOS 7上运行它时,我的后退按钮消失了。它在那里,仍在工作,可点击但不可见;
However, when i try to run it on iOS 7, my back button disappeared. It's there, still working and clickable but not visible;
- IOS 7 -
如何解决此问题?
推荐答案
设置 BackButtonBackgroundImage
通过 UIAppearance
目前在iOS 7中有一些奇怪的行为。这可能与更新的设计有关,它将rect-style按钮替换为backIndicatorImage(箭头)。
Setting BackButtonBackgroundImage
via UIAppearance
currently has some odd behavior in iOS 7. This is probably related to the updated design, which replaces the rect-style button with a backIndicatorImage (an arrow).
这留下了3个用于自定义后退按钮外观的选项:
This leaves 3 options for customizing the back button's appearance:
-
通过设置<$来更改backIndicatorImage的颜色
UINavigationBar
(或其中一个超类)的c $ c> tintColor 属性。
Change the color of the backIndicatorImage by setting the
tintColor
property onUINavigationBar
(or one of its superclasses).
在 UINavigationBar
backIndicatorImage 属性>到自定义图像。 (不要忘记设置 backIndicatorTransitionMaskImage
,否则它将无效)
Set the new backIndicatorImage
property on UINavigationBar
to a custom image. (don't forget to set the backIndicatorTransitionMaskImage
as well or it won't work)
创建自定义 UIBarButtonItem
并手动将其指定为 UINavigationItem
的 leftBarButtonItem
。 (参见上面提到的答案 Mashhadi )
Create a custom UIBarButtonItem
and manually assign it as UINavigationItem
's leftBarButtonItem
. (See the answer mentioned above by Mashhadi)
这篇关于在iOS 7中看不到后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!