iOS 7 UITextView vertical alignment

前端 未结 8 700
不思量自难忘°
不思量自难忘° 2020-11-29 04:21

How is that possible that my editable UITextView (placed inside a straightforward UIViewController inside a UISplitView that acts as delegate for t

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 05:01

    Try to call -sizeToFit after passing the text. This answer could be useful to Vertically align text within a UILabel.
    [UPDATE]
    I update this answer o make it more readable.
    The issue is that from iOS7, container view controllers such as UINavigationController or UITabbarController can change the content insets of scroll views (or views that inherit from it), to avoid content overlapping. This happens only if the scrollview is the main view or the first subviews. To avoid that you should disable this behavior by setting automaticallyAdjustsScrollViewInsets to NO, or overriding this method to return NO.

提交回复
热议问题