ios - 为导航栏添加标题和副标题,类似于 IOS 11 中的 Apple Music

标签 ios ios11

这是一个 IOS 11 问题。我不确定我们是否可以谈论这个,IOS 处于测试阶段。

但我正在查看 Apple Music 中的这个导航栏:

enter image description here

我知道他们在 IOS 11 中引入了大标题:

navigationController?.navigationBar.prefersLargeTitles = true

“为你”的文字看起来像标题,但他们是如何添加日期的?这是一个API吗?

起初我以为是 prompt 属性,但它会将文本设置在中间和顶部。

我想知道这是不是一些特殊的 IOS 11 API,或者他们只是使用了带有两个标签的 View 。

最佳答案

根据 WWDC 2017 Session 301 - Introducing the New App Store大约 10:30,就在显示 Today 交互时,它只是 collection view 的部分标题 而不是 UINavigationBar 的一部分(没有)。同样,这是针对 AppStore 的,但它看起来与音乐的 UI 相同。

关于重新创建 UI 的另一篇有趣的读物:Re-building the new app store app – today view

关于ios - 为导航栏添加标题和副标题,类似于 IOS 11 中的 Apple Music,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44748976/

相关文章:

ios - NSAttributedStringKey.attachment 与 NSAttachmentAttributeName

ios - 在 Phonegap 应用程序上使用 Swift 获取当前 UIViewController

ios - main_queue 上的 dispatch_async?

ios - 如何使用来自 complicationController 的 sendMessage 唤醒 iOS 父应用程序

iOS 11 : Height of UINavigationBar for large title (mimic Apple Music App)

ios - iOS 11 上的 Phonegap/Cordova 选择选项后再次显示弹出窗口

ios11 - MPMusicPlayerController 在 systemMusicPlayer 时响应慢,在应用时响应快

html - 在 HTML 输入字段中禁用 iOS 8 QuickType

ios - 如何获取 RTLabel 的高度

ios - 无法在 iOS11.3 中的 WKWebView POST 请求上设置 httpBody