2011-07-29 9 views
0

ContainerViewでUILabelを使いたいです。
私はこのコードを使用しています。ContainerView hide 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という

すべてのソリューションのテキストを隠すということです?

[self.view bringSubviewToFront:myLabel]; 

答えて

0

は、あなたcontainerViewあなたがcontainerView後にラベルを追加したり、これを行うのいずれかのラベルの上に追加されていることです。 それ以外の場合はuは@のxs2bushなど行うことができますがChallengeViewラベルを隠し

[self.view bringSubviewToFront:myLabel]; 

Bcz、と述べました。

+0

です! ありがとうxs2bush .. :) – iUser

0

あなたはその後、mylabelというを追加し、最初のChallengeViewを追加します。何が起こっている

+0

私はそれを持っている.. :) Thanx EXC_ .. !! – iUser