【发布时间】:2014-05-18 21:15:16
【问题描述】:
我有一个带有电子邮件地址的UITextView,我想设置它,以便当用户点击它时,它会调出电子邮件控制器。所以我设置了selectable 和dataDetectorTypes 属性,并输入了所需的电子邮件地址作为UITextView 的文本。
这工作正常,但问题是 IOS7 中文本的自动突出显示与我的 UIViewController 的背景相同的蓝色阴影。所以基本上文字消失了,我需要改变它的颜色。
环顾四周的人建议仅在将文本视图设置为selectable 后更改文本、字体和文本颜色。但这似乎不起作用。无论我尝试将其设置为哪种颜色,它都保持相同的蓝色阴影。
有什么想法吗?这是我正在使用的代码:
UITextView* emailText = [[UITextView alloc] initWithFrame:CGRectMake(20, 230, 280, 40)];
emailText.backgroundColor = [UIColor clearColor];
emailText.editable = NO;
emailText.scrollEnabled = NO;
emailText.dataDetectorTypes = UIDataDetectorTypeAll;
if(IS_OS_7_OR_LATER) {
emailText.selectable = YES;
}
emailText.font = [UIFont fontWithName:@"OpenSansHebrew-Bold" size:28];
emailText.textColor = [UIColor whiteColor];
emailText.text = @"our email address";
[self.view addSubview:emailText];
【问题讨论】:
标签: ios uitextview