0

I've have a UIView which has several UIViews (view1-view10) and UILabels (label1-label3) as subviews. label 2 is on top of view 3, and I have set label2's background color to clear, but I still get a white box around the label2 which blocks off some of my view 3. How do I set it up so that the non text area is clear? I took a screenshot and posted here:

enter image description here

UILabel * newLabel = [[UILabel alloc] initWithFrame:CGRectMake([[properties objectAtIndex:1] intValue], [[properties objectAtIndex:2] intValue], [[properties objectAtIndex:3] intValue], [[properties objectAtIndex:4] intValue])];
[newLabel setBackgroundColor:[UIColor clearColor]];
[self addSubview:newLabel];
4

2 回答 2

3

此外,请确保此标签的 opaque 属性为 NO。

于 2013-08-19T02:17:19.700 回答
0
[self.view bringSubviewToFront:label];
于 2013-08-19T07:51:58.200 回答