iOS 13 - When Search Active Push to other VC then that VC UITableView goes under the NavigationBar in Swift 4

给你一囗甜甜゛ 提交于 2019-12-02 13:43:25

问题


I have check this in iOS 12 it's working fine. Issue is when I am going to search and push to second VC it working fine. when I back and again push to second VC then UITableview goes under the NavigationBar. Normal push working fine only issue when search active and push second time.

I have try this below solution but none of this are working for me.

  1. UnderTopBar
  2. forKeyPath:"hidesShadow"
  3. edgesForExtendedLayout
  4. automaticallyAdjustsScrollViewInsets
  5. extendedLayoutIncludesOpaqueBars
  6. self.view layout too.

Please check this GIF

if anyone have answer of this and any suggestion then please tell me. Thank You.


回答1:


IF any one have same issue then please try this solution..

It's working for me. I hope it's working for you too.

Objective-C

-(void)viewWillDisappear:(BOOL)animated{
    if (@available(iOS 13.0, *)) {
        [self.navigationController.view setNeedsLayout]; 
        [self.navigationController.view layoutIfNeeded];
    }
}

Swift

func viewWillDisappear(_ animated: Bool) {
    if (@available(iOS 13.0, *)) {
         self.navigationController?.view.setNeedsLayout()     
         self.navigationController?.view.layoutIfNeeded()
    }
}

If this is not working then please check in OS Version 13.1.3. I think it's working.



来源:https://stackoverflow.com/questions/58427943/ios-13-when-search-active-push-to-other-vc-then-that-vc-uitableview-goes-under

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