On iphone 6, the label looks fine. On iphone 4, some text is not visible.
1 answer
You can use label.adjustsFontSizeToFitWidth = YES; , then the font size will decrease to fit the text in the label.
Update
to change programmatically (for example, to make the width equal to the width of the screen):
CGRect tmp = self.label.frame; tmp.size.width = [UIScreen mainScreen].bounds.size.width; self.label.frame = tmp; - And if the text climbs out of the screen? - user191924
- then either use autolayout or change the
frameprogrammatically, depending on the screen width - Max Mikheyenko - How to change software? - user191924
- added to the answer. - Max Mikheyenko
|