iphone - 如何使用 UIAppearance 在 UINavigationBar 上设置提交按钮的样式?

标签 iphone ios cocoa-touch

我正在使用 UIApperance 设计我的 iOS 应用程序的样式.我已经成功地制作了我所有 UINavigationBar 中的所有栏按钮项目。 s 有灰色文本,除了一个特定的按钮 - MFMessageComposeViewController View 的发送按钮保留为默认的白色。为什么我的代码针对除此按钮之外的所有按钮?

enter image description here

NSDictionary* normalStyle = [NSDictionary 
    dictionaryWithObjects:[NSArray 
        arrayWithObjects:
            [UIColor navigationTextNormalColor],
            [UIColor whiteColor],
            [NSValue 
                valueWithUIOffset:UIOffsetMake(
                    0, 
                    1
                )
            ]
            , nil
        ]
        forKeys:[NSArray
            arrayWithObjects:
                UITextAttributeTextColor,
                UITextAttributeTextShadowColor,
                UITextAttributeTextShadowOffset,
                nil
        ]
];

[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationController class], nil] 
    setTitleTextAttributes:normalStyle
    forState:UIControlStateNormal
];

[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil] 
    setTintColor:[UIColor navigationBarTintColor]
];

最佳答案

根据文档:

http://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html

Important The mail composition interface itself is not customizable and must not be modified by your application. In addition, after presenting the interface, your application is not allowed to make further changes to the email content. The user may still edit the content using the interface, but programmatic changes are ignored. Thus, you must set the values of content fields before presenting the interface.

关于iphone - 如何使用 UIAppearance 在 UINavigationBar 上设置提交按钮的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10778946/

相关文章:

ios - Swift 将多个类分配给 UI 元素

ios - 使用 AVCaptureMetadataOutput 和 AVFoundation 扫描条形码

ios - 为什么我们要将文件所有者View Outlet与nib文件中的 View 对象连接起来

ios - 突出显示整个 UIButton,而不仅仅是左侧的图像?

javascript - Onclick 无法使用 html 在 iphone 中的列表上工作

iphone - iPhone 中的加速计范围

ios - 获取从 NSInvocationOperation 返回的结果

ios - 使用WKWebView读取本地存储数据

ios - 核心数据中的 Float64?

iPhone:获取相机预览