【发布时间】:2012-05-24 12:20:14
【问题描述】:
我正在尝试使用以下页面上的解决方案: UITextView highlightedTextColor or similar option?
但是,我发现当我在 UITextView 上调用 setTextColor 并将颜色设置为 Color blackColor 以外的任何颜色时,UITextView 中的内容似乎发生了变化,并且我设置的颜色不会。
玩玩,我可以通过在我的 UITableViewCell 中修改以下初始化代码来重复此行为:
_notesTextView = [[UITextView alloc] initWithFrame:CGRectZero];
[_notesTextView setFont:[UIFont systemFontOfSize:12.0]];
[_notesTextView setTextColor:[UIColor redColor]];
[_notesTextView setUserInteractionEnabled:NO];
[self.contentView addSubview:_notesTextView];
与我保留默认颜色或设置为 blackColor 时相比,上面的代码将导致 textView 显示与我期望的偏移,并且文本也不显示为红色。
这太奇怪了 - 知道可能是什么问题吗?
【问题讨论】:
-
截图?没什么可做的。
标签: objective-c ios