2

我有一个 UITextView,我在其中向框架添加了一些阴影,但是当我写的时候,文本也得到了相同的阴影。如何避免这个问题?

我的代码:

commentary = [[UITextView alloc]initWithFrame:CGRectMake(10, 435, 230, 120)];
commentary.font = STANDARDFONT;
commentary.backgroundColor = BACKGROUND;
commentary.layer.shadowColor = [UIColor blackColor].CGColor;
commentary.layer.shadowOffset = CGSizeMake(2, 2);
commentary.layer.shadowOpacity = 0.8;
commentary.layer.shadowRadius = 2.0;
commentary.layer.borderColor = [UIColor grayColor].CGColor;
commentary.layer.borderWidth = 1.5;
commentary.layer.cornerRadius = 5;
commentary.layer.masksToBounds = NO;
commentary.clipsToBounds = NO;
[self addSubview:commentary];

背景和标准是[UICOLOR clearColor].CGColor[UIFont fontWithName:@"TimesNewRomanPSMT" size:16];

4

1 回答 1

0

尝试设置图层背景颜色:commentary.layer.backgroundColor = BACKGROUND.CGColor

于 2012-11-15T10:56:21.803 回答