iOS 11 issues with Refresh Controller and navigationBar that has prefersLargeTitles set to true

狂风中的少年 提交于 2019-12-22 06:51:08

问题


I am using a navigation controller and within that navigation controller, I have a VC with a tableview that is hugging the top, bottom, left and right sides of the superView. When I have self.navigationController?.navigationBar.prefersLargeTitles set to false, everything works fine. But when I set it to true, I have to drag really really far down to get my refresh controller to trigger the refresh.

This is fixed by simply tapping one cell which then goes into the detail view and then pressing the back button from the detail view to go back to the vc with the main tableview and refresher. After doing that the pull to refresh works perfectly with the large titles. Very weird!

I have a very basic setup of my tableview. My actual project has a more complex setup but in order to isolate this problem, I created a much simpler project with the same tableview and the issue persisted. Has anybody else seen this issue? I am thinking it is an issue on apple's end but I wanted to check if I was doing something wrong on my end.

I am using swift 4 and iOS 11.0.2 with Xcode 9.

The animator starts to animate but when it gets a certain (the point where it should refresh), it just stops. When I keep on pulling down further and further, it does the refresh. But it should have done it much earlier. I have to pull down to the point where the nav bar stretches to almost the entire length of the screen. See the screenshot.


回答1:


you can try to set self.extendedLayoutIncludesOpaqueBars = YES;




回答2:


You try this by adding the constraint of tableview.top to View.top of ViewController instead of topLayoutGuide



来源:https://stackoverflow.com/questions/46595093/ios-11-issues-with-refresh-controller-and-navigationbar-that-has-preferslargetit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!