我动态创建了一个 UILabel,我将动态更新数据。
我得到了很多行的输出,这很好我的问题是在下一行中间换行虽然我使用换行模式自动换行
帮我解决这个问题,我从 5 小时开始搜索它。
传递给该 UILabel 的数据是 orthogonist,endonist,psychologist,cardioligist
CGSize constraint8 = CGSizeMake(190, 2000.0f);
CGSize size8=[temp sizeWithFont:[UIFont fontWithName:@"Helvetica-Bold" size:14] constrainedToSize:constraint8 lineBreakMode:UILineBreakModeWordWrap];
specialities1 =[[UILabel alloc]init];
[specialities1 setFrame:CGRectMake(124,218,190, size8.height)];
specialities1.textAlignment=UITextAlignmentLeft;
specialities1.backgroundColor=[UIColor clearColor];
specialities1.numberOfLines=0;
specialities1.lineBreakMode=UILineBreakModeClip;
specialities1.font=[UIFont fontWithName:@"Helvetica-Bold" size:14];
specialities1.text=[NSString stringWithFormat:@"%@ ",temp ];
[specialities1 sizeToFit];
[testscroll addSubview:specialities1];