gpt4 book ai didi

ios - 自定义后退按钮出现在 UIImagePickerController 上

转载 作者:可可西里 更新时间:2023-11-01 04:16:27 24 4
gpt4 key购买 nike

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

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 并在照片库中输入一个相册时,后退按钮也是自定义的后退按钮。如何恢复图像选择器中的原始后退按钮?

最佳答案

 [[UIBarButtonItem appearanceWhenContainedIn:[UIImagePickerController class], nil] setBackButtonBackgroundImage:[UIImage imageNamed:@"blank-button"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

这是正确的做法

关于ios - 自定义后退按钮出现在 UIImagePickerController 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13405390/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com