如何让文字更亮? IOS 7

时间:2013-12-26 14:52:34

标签: text ios7 alpha

我用小alpha做了一个视图,在这个视图中我得到了文本标签,文本是灰色的,我不会在我的视图中更改alpha。如何让文字更亮?

1 个答案:

答案 0 :(得分:1)

我认为你的意思是视图应该是半透明的,但文字不应该。

您可以通过设置半透明背景颜色来实现:

UIColor *semitrasparentRedColor = [[UIColor redColor] colorWithAlphaComponent:0.3f];
UIView *myViewWithSemitransparentBackground = [[UIView alloc] initWithFrame:myFrame];
myViewWithSemitransparentBackground.backgroundColor = semitrasparentRedColor;

[myViewWithSemitransparentBackground addSubview:myLabel];