我正在使用 UIApperance 设计我的 iOS 应用程序的样式.我已经成功地制作了我所有 UINavigationBar 中的所有栏按钮项目。 s 有灰色文本,除了一个特定的按钮 - MFMessageComposeViewController View 的发送按钮保留为默认的白色。为什么我的代码针对除此按钮之外的所有按钮?
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]
];
最佳答案
根据文档:
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/