iOS 13 - When Search Active Push to other VC then that VC UITableView goes under the NavigationBar in Swift 4(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.
UnderTopBarforKeyPath:"hidesShadow"edgesForExtendedLayout自动调整ScrollViewInsetsextendedLayoutIncludesOpaqueBarsself.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 下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:iOS 13 - 当搜索主动推送到其他 VC 时,该 VC UITableView 在 Swift 4 中的 NavigationBar 下
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
