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];
그것은 작동합니다 .. !! 감사 xs2bush .. :) – iUser