标签栏标签溢出
如果没有足够的空间来显示标签,我是否可以在 iPhone 上隐藏标签。我能想到的最好的例子是在 Android 音乐播放器上,显示“艺术家”、“专辑”、“歌曲”选项卡,但“最近”、“播放列表”、“流派”隐藏在这些选项卡的左侧或右侧。
Is there anyway that I can have tabs on an iPhone hide if there is not enough room to display them. The best example I can think of is on Android Music Player the tabs for "Artist", "Albums", "Songs" are displayed but "Recent", "Playlists", "Genres" are hidden to the left or right of these tabs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有简单的方法可以做到这一点,不。事实上,我怀疑 Apple HIG 是否会允许这样做。
但是,如果您决定继续,则需要将 UITabBar 的
hidden
属性设置为YES
。这只会隐藏它 - 您可能还需要调整视图的大小。整个过程绝对不是微不足道的,也不应该是微不足道的,因为这是根本不应该做的事情 - 用户可能会欣赏额外的空间,但会立即迷失。
There's no easy way to do that, no. In fact, I doubt the Apple HIG would even allow it.
Should you, however, decide to proceed anyway, you'll want to set the
hidden
property of the UITabBar toYES
. This will only hide it - you may also have to resize the views.This entire process definitely isn't trivial nor should it be, since it's something that simply shouldn't be done - users may appreciate the extra space but will immediately get lost.
您可以通过设置 IBOutlet 将选项卡栏设置为隐藏。更好的是,以这样的方式进行编码,当用户点击屏幕时,会出现选项卡栏,类似于用户点击屏幕时出现的工具栏。这非常简单,并且可以释放屏幕空间!
You can set the tabbar to be hidden, by setting up an IBOutlet. Better yet, code it in such a way that when the user taps the screen, the tabbar appears, similar to a toolbar appearing when user taps the screen. It is very simple to do, and frees up screen space!