我做的代碼如下:程序化方式創建的UILabel
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"Telechargez et consultez les catalogues et les tarifs de la gamme Audi au format PDF";
[self.view addSubview:label];
它看起來像this 但我希望它看起來像this。如何更改標籤的屬性?
作爲SEP-05-2013 UILineBreakModeCharacterWrap其已過時的。相反,你可以使用label.lineBreakMode = NSLineBreakByCharWrapping,它可以完成與另一個相同的功能。 – Jiraheta
謝謝,你可以編輯我的答案。 – Jhaliya