gpt4 book ai didi

cocoa-touch - iOS导航栏更喜欢大标题滚动行为

转载 作者:行者123 更新时间:2023-12-04 16:38:29 24 4
gpt4 key购买 nike

在iOS 11中,如果启用了preferredsLargeTitles,则当您向下滚动时,所有系统应用程序都会压缩导航栏:

enter image description here

我无法弄清楚如何在自己的应用程序中实现此功能,默认情况下,该栏保持不变:

enter image description here

我唯一能看到的是“滑动时隐藏条”,但这隐藏了整个条而不是压缩它:

enter image description here

这只是在Xcode 9 beta中创建的空项目,并添加了新的 Storyboard。

我需要怎么做才能获得与系统应用程序相同的行为?

最佳答案

不要在Interface Builder/Storyboard中仅在代码中设置有关的大标题的任何内容。那对我有用。

因此,在 Storyboard 中的导航栏中,未选中“喜欢大标题”。

在您的 View Controller 中:
self.navigationController?.navigationBar.prefersLargeTitles = true

关于cocoa-touch - iOS导航栏更喜欢大标题滚动行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46101935/

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