에 UILabel의를 추가하는 방법을 내가 내 응용 프로그램에서 큰 이미지가 있습니다. 나는 동적으로 생성하고 난이 이미지에 UILabel의를 추가 할 :있는 UIImageView
UIImageView *thumbnailImage;
thumbnailImage = [[UIImageView alloc] initWithFrame:CGRectMake(xImage, yImage, imageWidth, imageHeight)];
UILabel *lblTitle = [[UILabel alloc] init];
lblTitle.text = @"SomeText";
lblTitle.frame = CGRectMake(xTitle, yTitle , titleWidth ,titleHeight);
[thumbnailImage setContentMode:UIViewContentModeScaleAspectFill];
thumbnailImage.clipsToBounds = YES;
[thumbnailImage addSubview:lblTitle];
하지만 [thumbnailImage addSubview:UILabel];
코드가 작동하지 않습니다.
어떤 아이디어가 있습니까? 당신이 파단를 추가 할 수 있도록
어디에서 레이블의 텍스트를 설정합니까? 비 투명 배경색을 지정하지 않으면 빈 레이블이 표시되지 않습니다. – giorashc
lblTitle – yurish
UILabel 대신 UILabel을 추가하고 lable에 대한 텍스트를 설정하면 실수를 입력하는 중입니다. 내가 편집 해. – Aqil