Resize font size to fill UITextView?

后端 未结 15 985
春和景丽
春和景丽 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:48

    U can easily do this by using

    • self.textview.font =

    self.textview.font = UIFont(name: self.textview.font!.fontName,
    size: self.textview.frame.size.height / 10)!

    divide textview.frame.size.height upon some constant based on your requirement..

提交回复
热议问题