iOS 13-当搜索主动推送到其他VC时,该VC UITableView会进入Swift 4中的NavigationBar下方 [英] iOS 13 - When Search Active Push to other VC then that VC UITableView goes under the NavigationBar in Swift 4

查看:43
本文介绍了iOS 13-当搜索主动推送到其他VC时,该VC UITableView会进入Swift 4中的NavigationBar下方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在iOS 12中检查了它的工作状况.问题是,当我要搜索并推送到第二个VC时,它工作正常.当我再次推回第二个VC时,UITableview会在NavigationBar下.仅当搜索处于活动状态并且第二次推送时,正常的推送工作才能正常进行.

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.

  1. UnderTopBar
  2. forKeyPath:"hidesShadow"
  3. edgesForExtendedLayout
  4. 自动调整ScrollViewInsets
  5. extendedLayoutIncludesOpaqueBars
  6. self.view布局.
  1. UnderTopBar
  2. forKeyPath:"hidesShadow"
  3. edgesForExtendedLayout
  4. automaticallyAdjustsScrollViewInsets
  5. extendedLayoutIncludesOpaqueBars
  6. self.view layout too.

请检查此GIF

如果有人对此有任何建议和答案,请告诉我.谢谢.

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

推荐答案

如果任何人都遇到相同的问题,请尝试此解决方案..

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];
    }
}

快速

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

如果这不起作用,请检入OS版本13.1.3.我认为它正在运行.

这篇关于iOS 13-当搜索主动推送到其他VC时,该VC UITableView会进入Swift 4中的NavigationBar下方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆