On the internet to see some, found a lot about the height of self-adaptation, can not be used, just write a kind of I used it! Ensure that you can paste the copy directly into Xcode to run.
UILabel *label = [[UILabel alloc] init];
Label.text = @ " Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ";
The system defaults to a single line, 0 for multiple lines
Label.numberoflines = 0;
200 indicates a maximum length of 200 per row, less than 200 by text length
CGRect rectoftext = CGRectMake (100, 100, 200, 999);
Rectoftext = [Label Textrectforbounds:rectoftext limitedtonumberoflines:0];
Label.frame = Rectoftext;
[Self.view Addsubview:label];
The level is limited, if has the omission, the mistake, welcome correction! If there is a problem, discuss it together.
Uilabel Self-adapting height