繁体   English   中英

导航栏与 iOS7 中另一个视图控制器的导航栏重叠

[英]Navigation Bar is overlapping with another View Controller's Navigation Bar in iOS7

该应用程序的最低版本是在 iOS 7 上设置的。但是我的测试设备是在 iOS 9 上。由于 XCode 7 无法运行 iOS7 模拟器,我无法在 iOS7 上测试我的应用程序。
然而,远程测试团队正在 iOS 7 上进行测试,他们在以下屏幕截图中报告了这个问题 -

重叠

这发生在多个地方。 仅当我执行 push segue(已在情节提要中定义)时才会发生这种情况。 我无法在 iOS9 中重现此问题。 我无法签入 iOS8,因为我的模拟器表现得很奇怪。

那么我怎样才能找到这种奇怪行为的确切原因呢? 为什么会在第一时间发生? 难道我做错了什么? 最后,如何在不需要实际 iOS7 设备的情况下调试它?

更新:
我在viewDidLoad中尝试了以下几行

self.automaticallyAdjustsScrollViewInsets = NO
self.edgesForExtendedLayout = UIRectEdgeNone;

但它仍然没有工作。 我正在使用 Crashlytics 并发现一个与此最相关的特定问题。 这是这个的链接

崩溃日志

这是摘录

Fatal Exception: NSInvalidArgumentException
Can't add self as subview
Thread : Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x30b42f83 __exceptionPreprocess
1  libobjc.A.dylib                0x3b2f3ccf objc_exception_throw
2  CoreFoundation                 0x30b42ec5 -[NSException initWithCoder:]
3  UIKit                          0x3336b535 -[UIView(Internal) _addSubview:positioned:relativeTo:]
4  UIKit                          0x3336b4bf -[UIView(Hierarchy) addSubview:]
5  UIKit                          0x33533f71 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke
6  UIKit                          0x33371ac5 +[UIView(Animation) performWithoutAnimation:]
7  UIKit                          0x33533879 -[_UINavigationParallaxTransition animateTransition:]
8  UIKit                          0x334f0b27 -[UINavigationController _startCustomTransition:]
9  UIKit                          0x3340dd63 -[UINavigationController _startDeferredTransitionIfNeeded:]
10 UIKit                          0x3340db6d -[UINavigationController __viewWillLayoutSubviews]
11 UIKit                          0x3340db05 -[UILayoutContainerView layoutSubviews]
12 UIKit                          0x3335fd59 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
13 QuartzCore                     0x32fdd62b -[CALayer layoutSublayers]
14 QuartzCore                     0x32fd8e3b CA::Layer::layout_if_needed(CA::Transaction*)
15 QuartzCore                     0x32fd8ccd CA::Layer::layout_and_display_if_needed(CA::Transaction*)
16 QuartzCore                     0x32fd86df CA::Context::commit_transaction(CA::Transaction*)
17 QuartzCore                     0x32fd84ef CA::Transaction::commit()
18 QuartzCore                     0x32fd221d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
19 CoreFoundation                 0x30b0e255 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
20 CoreFoundation                 0x30b0bbf9 __CFRunLoopDoObservers
21 CoreFoundation                 0x30b0bf3b __CFRunLoopRun
22 CoreFoundation                 0x30a76ebf CFRunLoopRunSpecific
23 CoreFoundation                 0x30a76ca3 CFRunLoopRunInMode
24 GraphicsServices               0x3597c663 GSEventRunModal
25 UIKit                          0x333c314d UIApplicationMain
26 Palscom                        0xf1463 main (main.m:14)
27 libdyld.dylib                  0x3b800ab7 start

他们看起来有关系吗? 如果他们是什么可能是这个原因?

self.automaticallyAdjustsScrollViewInsets = NO

在 viewDidLoad 然后检查

重叠的导航栏颜色是半透明的,将其设置为纯色可以解决问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM