iOS7所有这些颜色有什么区别,"barTintColor,tintColor,backgroundColor,UITextAttributeTextColor"?

use*_*270 8 tintcolor ios7

我对iOS7中的navigationController中的所有这些颜色设置感到困惑.有人能告诉我这些东西之间究竟有什么区别吗?我试图找出其中一些,但不确定我是否正确.

谢谢!

self.navigationController.navigationBar.barTintColor=[UIColor redColor];//???

self.navigationController.navigationBar.backgroundColor=[UIColor greenColor];//???

self.navigationController.navigationBar.tintColor=[UIColor whiteColor];//the text colour of backButton of the navigationBar???

self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor:[UIColor blueColor]};//the text color of the title of the navigationBar

 [self.navigationItem.rightBarButtonItem setTitleTextAttributes:@{UITextAttributeTextColor:[UIColor greyColor]} forState:UIControlStateNormal];//the text colour of the customised rightButton in the navigationBar
Run Code Online (Sandbox Code Playgroud)

Div*_*iya 15

以下是上述之间的区别:

barTintColor:应用于导航栏背景的色调颜色.

backgroundColor:更改navigationBar的背景颜色

tintColor:应用于导航项和条形按钮项的色调颜色.

UITextAttributeTextColor: 文本属性字典中文本颜色的关键字.对应的值是UIColor的实例. Available in iOS 5.0 and later.Deprecated in iOS 7.0.这是一个easy fix.只是改变UITextAttributeTextColor to NSForegroundColorAttributeName

以下是更多详细信息:https://developer.apple.com/library/ios/documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html

  • 那么色调颜色到底是什么?我以为这只是物品的颜色。 (3认同)
  • “要应用于导航栏背景的色泽??您什么都没解释... (3认同)