【问题标题】:UITextView text color always black on iPhone 4 and iPhone 5 on Xamarin.iOS在 Xamarin.iOS 上的 iPhone 4 和 iPhone 5 上的 UITextView 文本颜色始终为黑色
【发布时间】:2016-12-08 08:29:08
【问题描述】:

每当我尝试设置TextColor 时,它都没有效果。

NotesText.TextColor = UIColor.White;
NotesText.Text = notes;

在故事板或 XIB 文件中设置文本颜色也无效

我已经在 iPhone 4 上对此进行了测试,并且在 iPhone 5 上也有过这种情况的报告。

【问题讨论】:

    标签: xamarin xamarin.ios uitextview


    【解决方案1】:

    这似乎是 Xamarin.iOS 中的一个错误。

    如果你切换语句,让文本内容设置在文本颜色之前,它突然起作用了。

    NotesText.Text = notes;
    NotesText.TextColor = UIColor.White;
    

    我猜在故事板和 XIB 文件中,Xamarin 在内容文本之前在内部设置文本颜色,因此会出现错误。

    编辑:

    这似乎与以下问题相同:UITextView text color not getting set when disabled selectable property。所以这不是 Xamarin 特有的,而是 iOS 中的一个错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-03
      • 2019-08-13
      • 1970-01-01
      • 2019-06-14
      • 2019-09-19
      • 1970-01-01
      相关资源
      最近更新 更多