作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在我的应用程序的导航 Controller 中有一个自定义导航栏图像,使用 UIAppearance 协议(protocol)设置。但是,当通过应用程序发送邮件时(通过 MFMailComposeViewController
),我想要默认的导航栏而不是自定义导航栏。我尝试了这个问题中概述的方法:UIAppearance Remove Custom NavBar Background for UIPopoverController但它没有用。我使用的代码是:
[[UINavigationBar appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
但是没有任何效果。我的应用程序是 iOS 6+。这是 MFMailComposeViewController
特有的东西还是我遗漏了什么?
编辑:尝试了其他方法:
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
mailer.navigationBar.barStyle = UIBarStyleBlack;
[self.navigationController presentViewController:mailer animated:YES completion:nil];
[mailer.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
设置 UIBarStyleBlack
有一些效果,因为“取消”按钮随后变黑,但背景图像仍设置为旧值。
最佳答案
尝试这样的事情:
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
[mail.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
这应该为这个实例重置背景图像。
关于ios - UIAppearance 移除 MFMailComposeViewController 的自定义 NavBar 背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15098428/
我正在做一个项目,我的 android 在这个项目中作为一个网络服务器工作;输入带端口号的 IP 地址,打开 Web 界面,用户可以将文件上传到手机。我想在 Web 界面上显示一些图片,以便我们的界面
我是一名优秀的程序员,十分优秀!