Ios4 我想对这句话破例;“包含时的外观”;呼叫(xcode 4.2,iOS 5.0)

Ios4 我想对这句话破例;“包含时的外观”;呼叫(xcode 4.2,iOS 5.0),ios4,xcode4,ios5,Ios4,Xcode4,Ios5,我在AppDelegate中调用了“ApparanceWhenContainedin”方法来设置导航控制器类中所有按钮的标题颜色。电话如下: [[UIButton appearanceWhenContainedIn:[UINavigationController class],nil] setTitleColor [UIColor colorWithRed:0 green:0.475 blue:0.227 alpha:1] forState:UIControlStateNormal];

我在AppDelegate中调用了“ApparanceWhenContainedin”方法来设置导航控制器类中所有按钮的标题颜色。电话如下:

    [[UIButton appearanceWhenContainedIn:[UINavigationController class],nil] setTitleColor
[UIColor colorWithRed:0 green:0.475 blue:0.227 alpha:1] forState:UIControlStateNormal];
这是我想要的方式,但是,有一个UIView,我在工具栏中有一个按钮,我想保持按钮的标题文本为白色(而不是更改颜色)。按钮和工具栏被添加到我的.xib文件中,我将按钮附加到一个iAction上,该iAction解除了模态视图控制器(它是一个“关于”视图)

我如何更改此特定按钮的文本颜色,或在调用中包含时在外观中设置例外


非常感谢你的帮助

我想在我的例子中,因为按钮在工具栏中,所以我在AppDelegate中使用了customizeAppearance方法来更改工具栏中所有按钮项的外观。代码是:

[[UIBarButtonItem appearance] setTitleTextAttributes:
     [NSDictionary dictionaryWithObjectsAndKeys:
      [UIColor whiteColor],
      UITextAttributeTextColor,
      [UIColor whiteColor],
      UITextAttributeTextShadowColor,
      [NSValue valueWithUIOffset:UIOffsetMake(0, 1)],
      UITextAttributeTextShadowOffset,
      [UIFont fontWithName:@"ArialMT" size:0.0],
      UITextAttributeFont,
      nil]

对不起,各位,我找到了解决这个问题的方法。非常感谢。