【问题标题】:Change tint color UIAlertController iOS9更改色调颜色 UIAlertController iOS9
【发布时间】:2015-09-24 13:13:52
【问题描述】:

我不确定是否有人遇到过这种行为,但 iOS9 正在让我的 UIAlertController 色调从主窗口继承。是否有任何特定方式可以帮助和解决问题,例如 UIAppearance。

[[UICollectionViewCell appearanceWhenContainedIn:[UIAlertController class], nil] setTintColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:1]];

【问题讨论】:

  • 无论警报视图后面的内容是什么,它都会显示在警报视图上,正是警报的透明度给你的印象是色调!!!
  • 您可以更改 alertcontroller 的 tint,backgroundColor,alpha 属性。你还需要什么
  • @Mr.T 我明白这一点,但到目前为止我还没有发现在 iOS9 中覆盖色调颜色的方法。而且这种行为仅适​​用于 UIAlertController
  • 这似乎是 ios 9 中的回归 - openradar.appspot.com/22209332 - 我让 tintColor 在 iOS8 中完美运行

标签: objective-c ios9 uialertcontroller tint


【解决方案1】:

你有没有在AppDelegate中设置UIWindow的颜色像

func application(application: UIApplication, didFinishLaunchingWithOptionslaunchOptions: [NSObject: AnyObject]?) -> Bool
{
    window?.tintColor = .redColor()
}

至少这对我有用

【讨论】:

    【解决方案2】:

    由于 iOS 9 中引入的一个已知错误 (https://openradar.appspot.com/22209332),tintColor 被应用程序窗口的 tintColor 覆盖。

    在这里查看我的完整答案:

    https://stackoverflow.com/a/37737212/1781087

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-07
      • 2015-10-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多