【问题标题】:Increase UiTextView size as text increases [duplicate]随着文本的增加增加 UiTextView 的大小[重复]
【发布时间】:2018-06-28 15:25:25
【问题描述】:

我希望我的 UITextView 大小根据其中的文本增加,如果文本很长,那么它应该允许滚动。如何做到这一点?任何帮助将不胜感激。

【问题讨论】:

    标签: ios swift xcode


    【解决方案1】:

    这个解决方案会让我很开心,也可以帮助你

     func adjustTextView(_ textView : UITextView) {
            textView.scrollEnabled = false
            textView.translatesAutoresizingMaskIntoConstraints = true
            textView.sizeToFit()
        }
    

    【讨论】:

      猜你喜欢
      • 2012-11-07
      • 2020-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-22
      • 2019-06-07
      • 2015-06-01
      • 1970-01-01
      相关资源
      最近更新 更多