iOS 13 - 当搜索主动推送到其他 VC 时,该 VC UITableView 在 Swift 4 中的 Navig

2023-06-12移动开发问题
2

本文介绍了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 布局也是.

请查看此 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()
    }
}

如果这不起作用,请检查操作系统版本 13.1.3.我认为它有效.

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

The End

相关推荐

无法将文件从捆绑包复制到 iOS 中的文档目录
Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)...
2024-04-15 移动开发问题
4

如何复制“字典"在斯威夫特?
How to copy a quot;Dictionaryquot; in Swift?(如何复制“字典在斯威夫特?)...
2024-04-15 移动开发问题
10

Swift - 迭代结构对象时如何对其进行变异
Swift - How to mutate a struct object when iterating over it(Swift - 迭代结构对象时如何对其进行变异)...
2024-04-15 移动开发问题
7

如何使用 Swift 将文本复制到剪贴板/粘贴板
How to copy text to clipboard/pasteboard with Swift(如何使用 Swift 将文本复制到剪贴板/粘贴板)...
2024-04-15 移动开发问题
9

Swift 无法使用类型为“([Score],Score)"的参数列表调用“find",其中 Sco
Swift Cannot invoke #39;find#39; with an argument list of type #39;([Score], Score)#39; where Score is a struct(Swift 无法使用类型为“([Score],Score)的参数列表调用“find,其中 Score 是一个结构)...
2024-04-15 移动开发问题
6

目标 - C:从 URL 加载图像?
objective - C : Loading image from URL?(目标 - C:从 URL 加载图像?)...
2024-04-15 移动开发问题
7