大佬教程收集整理的这篇文章主要介绍了iphone – 使用UIAppearance为UIBarButtonItem设置后退按钮的文本颜色?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我知道如何设置背景图像:
[[UIBarButtonItem appearance] setBACkButtonBACkgroundImage:[UIImage imagenamed:@"arrow-button-static.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBACkButtonBACkgroundImage:[UIImage imagenamed:@"arrow-button-pressed.png"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
NSDictionary *attributes = [NSDictionary DictionaryWithObjectsAndKeys: [UIColor redColor],UITextAttributeTextColor,nil]; [[UIBarButtonItem appearance] settitleTextAttributes:attributes forState:UIControlStateNormal];
或者,仅在导航栏中的条形按钮:
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class],nil] settitleTextAttributes:attributes forState:UIControlStateNormal];
有关如何在视图/视图控制器层次结构的特定部分自定义外观的更多详细信息,请参阅UIAppearance
protocol docs.虽然如上所述,这不会让您全局使BACk按钮文本与同一导航栏中其他按钮的不同. (你可以直接改变每一个,因为你的视图控制器出现,但这可能不是一个好主意.)
哦,对不起弹ment的事情啊.
以上是大佬教程为你收集整理的iphone – 使用UIAppearance为UIBarButtonItem设置后退按钮的文本颜色?全部内容,希望文章能够帮你解决iphone – 使用UIAppearance为UIBarButtonItem设置后退按钮的文本颜色?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。