简体   繁体   English

如何调整大标题以保持过渡但隐藏大标题本身?

[英]How to tweak large title in order to keep the transition but hide the large title itself?

From a UITabbarViewController I have a root view controller CarDetails as in the first image.从 UITabbarViewController 我有一个根视图 controller CarDetails ,如第一张图片所示。 This VC can scroll upwards as shown in the second image, with the large title transitioning to regular navigation display, with the title entered, on the top.此 VC 可以向上滚动,如第二张图所示,大标题转换为常规导航显示,输入的标题位于顶部。

I want the initial view not to show the (large) title, while keeping the transitioning so that the title smoothly appears on top.我希望初始视图不显示(大)标题,同时保持过渡,以便标题平滑地出现在顶部。

How would you do that?你会怎么做?

未滚动

一旦滚动

Try this in XCode:在 XCode 中试试这个:

  1. Select your navigationController -> navigationbar. Select 您的 navigationController -> 导航栏。
  2. On the right side, in the Attributes inspector, change Large Title color from default to clear .在右侧,在属性检查器中,将大标题颜色从default更改为clear

更改大标题颜色

Here is the Swift version of @Starsky idea:这是@Starsky想法的Swift版本:

    navigationController?.navigationBar.largeTitleTextAttributes = [.foregroundColor: UIColor.clear]

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

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