solution of error: UITextview “Ignoring bogus layer size”

a weird error occured when I add a UITextView to UIViewController,”Ignoring bogus layer size” .It’s the first time this error come out.  finally i find the way to fix it:  set “automaticallyAdjustsScrollViewInsets” to false

 

override func viewDidLoad() {

override func viewDidLoad() {
   super.viewDidLoad()

   // Do any additional setup after loading the view.
        
   self.automaticallyAdjustsScrollViewInsets = false
}

  • Ace Green

    Solution doesn’t work for me. Its a weird issue, do we know why? Also when I added a UITextView into my ViewController, the default contentInset and LineFragmentation wasn’t there. Text was just shown with 0 inset. Usually I would need to force zero inset

    • Can u show your code? maybe some other reasons.

  • Glen Ruhl

    You’re pretty great Wangyan. I just ran into this problem and your fix did the trick. Nicely done.