UILabel文本换行在iPhone中不起作用?

Hon*_*ney 1 iphone xcode word-wrap

我有一个UILabel,它应该显示文本会持续多长时间。UILineBreakModeWordWrap的概念消失了,但对我不起作用..如果文本不适合该行,则应自动出现在下一行中线

UILabel *lblMyLable = [[[UILabel alloc] initWithFrame:CGRectMake(10,118, 600, 40)]autorelease];
    lblMyLable.lineBreakMode = UILineBreakModeWordWrap;
    lblMyLable.numberOfLines = 0;//Dynamic
    lblMyLable.tag=1301;
    lblMyLable.backgroundColor = [UIColor clearColor];
    lblMyLable.text = [NSString stringwithformat:@"%@ %@ %@ %@ %@ %@",id,name,address,city,state,country];
    [self.view addSubview:lblMyLable];
Run Code Online (Sandbox Code Playgroud)

但是在这里显示了ID,名称和地址后,其余部分被剪切了..我看不到..我正在搜索一种方式,如果它不适合一行,那么它应该自动从停下来的地方开始跳到下一行在第一行。我该怎么办?

Man*_*epa 5

NSString *str = @"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sh";
NSString *str1 = @"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sh";
NSString *str2 = @"xyz";
NSString *str3 = @"xyz";
NSString *str4 = @"xyz";
NSString *str5 = @"xyz";
NSString *str6 = @"xyz";
NSString *str7 = @"xyz";   

UILabel *lblMyLable = [[UILabel alloc] initWithFrame:CGRectMake(10,10, 200, 40)];

lblMyLable.numberOfLines = 0;

lblMyLable.backgroundColor = [UIColor clearColor];

lblMyLable.text = [NSString stringWithFormat:@"%@,%@,%@,%@,%@,%@,%@,%@",str,str1,str2,str3,str4,str5,str6,str7];

[lblMyLable sizeToFit];

[self.view addSubview:lblMyLable];
Run Code Online (Sandbox Code Playgroud)