在某些情况下,您希望在一秒钟内解决的事情变成了一生的冒险。这是其中一种情况:)
我想做的只是改变我的一个 UITextViews 的文本颜色。到目前为止,我尝试过:
UIColor *myColor = [UIColor colorWithHue:38 saturation:98 brightness:100 alpha:1.0];
[myTextView setTextColor:myColor];
或者
UIColor *myColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"colorImage.png"]];
[myTextView setTextColor:myColor];
两者似乎都适用于 UILabel,但不适用于 UITextView 元素。当我尝试 [UIColor colorWithHue...] 时,无论我选择什么值(黑色和白色的值除外。它们都有效),我只会得到一种略带红色的颜色。colorWithPatternImage 根本不会改变 textColor。
是不是很奇怪?我显然必须遗漏一些东西。非常感谢您的帮助。提前致谢。