Iphone ContainerView隐藏UILabel

Iphone ContainerView隐藏UILabel,iphone,xcode4,uilabel,Iphone,Xcode4,Uilabel,我想在ContainerView中使用UILabel。 所以我用这个代码来做这个 UILabel *myLabel = [[[UILabel alloc] initWithFrame:CGRectMake(16, 60, 300, 150)] autorelease]; myLabel.numberOfLines = 0; myLabel.font = [UIFont systemFontOfSize:13.5]; myLabel.text = [theQuiz objectAtIndex:ro

我想在ContainerView中使用UILabel。
所以我用这个代码来做这个

UILabel *myLabel = [[[UILabel alloc] initWithFrame:CGRectMake(16, 60, 300, 150)] autorelease];
myLabel.numberOfLines = 0;
myLabel.font = [UIFont systemFontOfSize:13.5];
myLabel.text = [theQuiz objectAtIndex:row+3] ;
myLabel.lineBreakMode = UILineBreakModeWordWrap;
myLabel.backgroundColor = [UIColor clearColor];
myLabel.layer.cornerRadius = 8.0;
[myLabel sizeToFit];
[self.view addSubview:myLabel];

//ContainerView
UIView *ChallengeView = [[UIView alloc] initWithFrame:CGRectMake(8, 55, 300, 10 + Challenge.frame.size.height)];
ChallengeView.layer.borderColor = [[UIColor purpleColor ] CGColor];
[ChallengeView setBackgroundColor:[UIColor whiteColor]];
ChallengeView.layer.cornerRadius = 8 ;
ChallengeView.layer.borderWidth = 1.5;
[self.view addSubview:ChallengeView];
[ChallengeView release];
现在的问题是,当我为ContainerView设置背景色时,它会隐藏myLabel的文本


有什么解决办法吗

发生的情况是,您的containerView被添加到标签上方,或者在containerView之后添加标签,或者执行以下操作:

[self.view bringSubviewToFront:myLabel];

首先添加ChallengeView,然后添加myLabel。 否则你可以像@xs2bush说的那样

[self.view bringSubviewToFront:myLabel];
Bcz挑战者视图隐藏了标签。

我知道了Thanx EXC!!