Autoshrink on a UILabel with multiple lines

前端 未结 17 2030
醉梦人生
醉梦人生 2020-11-28 21:31

Is it possible to use the autoshrink property in conjunction on multiple lines on a UILabel? for example, the large text size possible on 2 available lines.

17条回答
  •  隐瞒了意图╮
    2020-11-28 22:05

    For UIButton, just these lines are working for me:

    self.centerBtn.titleLabel.numberOfLines = 2;
    self.centerBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.centerBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
    

提交回复
热议问题