【问题标题】:UITextView not displaying full text on scrollingUITextView 在滚动时不显示全文
【发布时间】:2020-01-15 05:42:50
【问题描述】:

我有一个作为子视图添加到 UIViewController 主视图的 UITextView。 textView 在所有四个边上都与 safeArea 对齐。当视图控制器被推到 UINavigationController 上时,当我滚动时,文本视图有时会在底部被截断。旋转设备并返回显示全文。是否有任何我遗漏的配置需要添加到 Storyboard 中的 UITextView 中?

【问题讨论】:

  • 再次检查您的 textview 约束,确保其正确。

标签: ios swift uiviewcontroller uinavigationcontroller uitextview


【解决方案1】:

请在初始化 textView 时添加代码。

尝试将其添加到您的 ViewController

if #available(iOS 11, *) {
    myScroll.contentInsetAdjustmentBehavior = .never
} else {
    self.automaticallyAdjustsScrollViewInsets = false
}

【讨论】:

    【解决方案2】:

    无法获得您的确切场景,但您可以通过在运行时为 Protrait 和横向模式提供高度和宽度约束的常量值来检查(使用方向委托方法)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 1970-01-01
      • 2014-10-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多