Resize font size to fill UITextView?

后端 未结 15 1015
春和景丽
春和景丽 2020-12-01 07:03

How would I set the font size of text in a UITextView such that it fills the entire UITextView? I\'d like the user to type in their text, then have the text fill the entire

15条回答
  •  余生分开走
    2020-12-01 07:29

    Try this, it's a lot simpler:

    while (self.contentSize.height > self.frame.size.height)
    {
        self.font = [self.font fontWithSize:self.font.pointSize -1];
    }
    

提交回复
热议问题