gpt4 book ai didi

ios - UINavigationController.hidesBarsOnSwipe=YES 导致 NSInternalInconsistencyException

转载 作者:行者123 更新时间:2023-12-01 15:35:59 25 4
gpt4 key购买 nike

我在 UINavigationController 中嵌入了一个 UITableViewController。一切正常,直到我在 viewWillAppear 中将 UINavigationController 的属性 hidesBarsOnSwipe 设置为 YES。如果用户要稍微紧张地上下滚动,应用程序会崩溃并显示以下消息:

2016-10-10 13:47:27.973 xxx[4246:1716033] *** Assertion failure in -[_UIAnimationCoordinator finishInteractiveAnimation], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.60.12/_UIAnimationCoordinator.m:154
2016-10-10 13:47:27.974 xxx[4246:1716033] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Trying to finish an interactive transition that was not started interactively'


以下代码似乎是一种解决方法,但尽管如此,我还是想弄清楚,如果其他人有类似的问题并且可能找到了更好的解决方案。先感谢您!
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if(scrollView.contentOffset.y <= 10)
{
//scrollup
scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
[self.navigationController setNavigationBarHidden: NO animated:YES];
}
else if(scrollView.contentOffset.y >= 10)
{
//scrolldown
[self.navigationController setNavigationBarHidden: YES animated:YES];
}
}

顺便说一句:我可以在使用 XCode 7.3 的模拟器和设备上的 iOS 9.3.5 和 10.0.2 中重现此行为

最佳答案

对于有同样问题并像我一样进入此页面的每个人。
我修复了只打开属性检查器导航 Controller “隐藏栏”->“滑动时”(取消选中)的问题。
希望它可以帮助某人。
(xcode 11.5,操作系统 13.5.1)

关于ios - UINavigationController.hidesBarsOnSwipe=YES 导致 NSInternalInconsistencyException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39957771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com