自定义后退按钮出现在UIImagePickerController上 [英] Customized back button appears on UIImagePickerController

查看:108
本文介绍了自定义后退按钮出现在UIImagePickerController上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码在我的应用程序中自定义导航栏上的后退按钮:

I use the following code to customize the back button on the navigation bar throughout my application:

UIImage *backButton = [[UIImage imageNamed:@"backButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
UIImage *backButtonOn = [[UIImage imageNamed:@"backButton_on"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton
                                                  forState:UIControlStateNormal
                                                barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonOn
                                                  forState:UIControlStateHighlighted
                                                barMetrics:UIBarMetricsDefault];

除非我出示UIImagePickerController并在照片库中输入相册,后退按钮才有效还有定制的后退按钮。如何取回图像选择器中的原始后退按钮?

It's working great except when I present a UIImagePickerController and enter an album in the photo library the back button is also the customized back button. How can I get back the original back button in the image picker?

推荐答案

尝试使用此:

    [[UINavigationBar appearanceWhenContainedIn:[YourClassThatsNotAUIImagePicker class], nil] setBackButtonBackgroundImage:someOtherImage forBarMetrics:UIBarMetricsDefault];

这应该将您的外观设置限制为仅列出的类,因此单独保留UIImagePickerController。

That should limit your appearance setting to only the classes you list and therefore leave the UIImagePickerController alone.

这篇关于自定义后退按钮出现在UIImagePickerController上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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