- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我在“applicationDidFinishLaunching”中使用外观代理将 UIBarButtonItem 和 UINavigationBar titleTextAttributes 的外观更改为我的自定义字体,并将颜色更改为白色。每个导航标题文本和 BarButtonItems 都使用提供的自定义字体。
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
application.setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false)
UINavigationBar.appearance().barStyle = UIBarStyle.BlackTranslucent
UINavigationBar.appearance().barTintColor = NSFontAttributeName:SharedHelper.myCustomBarColor()
UINavigationBar.appearance().titleTextAttributes =[NSForegroundColorAttributeName:UIColor.whiteColor()]
UIBarButtonItem.appearance().tintColor = UIColor.whiteColor()
let attributes = [NSFontAttributeName:SharedHelper.customFontForBarButton()]
UIBarButtonItem.appearance().setTitleTextAttributes(attributes, forState: UIControlState.Normal)
return true
}
当我使用 MFMailComposeViewController 发送电子邮件时出现问题。 MFMailComposeViewController 忽略字体属性并恢复为默认字体。在 iPhone 5S 模拟器中,我可以看到自定义字体一段时间,但它恢复为默认字体。
在 iPhone Simulator 5S 中显示了一段时间。 (我正在努力做到这一点)
几秒后使用默认字体。
有什么帮助吗?外观代理不应该也适用于 MFMailComposeViewController 的 UIBarButton 和 NavigationBar 还是需要为此进行任何编码?
我正在使用 Swift,也尝试使用 Alexander 使用 Bridge 的 appearanceWhenContainedIn,但似乎没有用。我关心的是更改 MFMailComposeViewController 的 titleText 和 BarButtonItems(取消,发送)的字体。
提前致谢。任何帮助将不胜感激。
最佳答案
在过去的几天里,我一直在与 iOS 9 设备发生同样的问题。我已经尝试了几乎一切。但是,今天早上我将尝试将以下内容添加到 AppDelegate:
UIBarButtonItem.appearanceWhenContainedInInstancesOfClasses([MFComposeViewController.self]).setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.blueColor()], forState: .Normal)
我不能使用 UINavigationBar 类,因为它会影响整个应用程序的外观,而这不是我想要的。
如果有效,我会回复。
关于ios - MFMailComposeViewController Bar titleText 和 UIbarbuttons 不使用外观代理提供的自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32431762/
我在我的 android 游戏中使用 ScoreNinja(高分管理器),我想使用文档中提到的子板功能。 但是当我这样做的时候: mScoreNinjaAdapter.show(score, "Tes
有没有办法切换 title 的属性值? 好像文本标题是 在 我想用下面给出的代码切换它的标题文本和它的类: $('.postoption').click(function(){ $(thi
我正在尝试更改我的一个 View Controller 的字体大小,因为它适合更多文本,因此需要比我的其他 View 更小的字体大小。我在 didFinishLaunchingWithOptions
我在“applicationDidFinishLaunching”中使用外观代理将 UIBarButtonItem 和 UINavigationBar titleTextAttributes 的外观更
我是一名优秀的程序员,十分优秀!