简体   繁体   中英

Inside UIStackView UILabel not word warpped to next line

Below is my screen configured in Xcode storyboard. Inside the stack view, I want the same spacing I did via using stack view, but inside each view, in the stack view the label text is not wrapped to next line. I even use IBOutlet to change the label number of line, but it didn't work.

[_label1 setNumberOfLines : 0];
[_label1 sizeToFit];
[_label1 setText : @"63882748343487"];

在此处输入图片说明

1- You have to set leading/left and trailing/right for the label to wrap Or centerX & width ( proportional to it's superView ) constraints in addition to .lines = 0

2- It's better to decrease font size for these labels as you have 2 labels inside a limited width

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM