View frame changes between viewWillAppear: and viewDidAppear:

前端 未结 4 1956
慢半拍i
慢半拍i 2020-11-28 22:57

I have discovered a strange behavior in my application, where a connected IBOutlet has its connected view\'s frame between the calls in my view controller to

4条回答
  •  一向
    一向 (楼主)
    2020-11-28 23:31

    call

    self.scrollView.layoutIfNeeded()

    in your viewWillAppear method. Afterwards you can access it's frame and it will have the same value as you print in viewDidAppear

提交回复
热议问题