首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在iphone 6+ iOS8.3上,TabBarController的“更多”标签以横向模式出现

在iphone 6+ iOS8.3上,TabBarController的“更多”标签以横向模式出现
EN

Stack Overflow用户
提问于 2015-05-06 18:11:01
回答 1查看 467关注 0票数 0

在我的应用程序中,我正在使用标签栏控制器,我在TabBar控制器中有10个标签,在纵向模式下,屏幕上只有4个标签可见,其余6个标签隐藏在“更多”标签中。

问题出在Iphone6+(8.3)上,当我在横向旋转手机时,隐藏在“更多”选项卡中的选项卡出来了,并且在屏幕上是可见的,这样屏幕上就可以看到7个选项卡,其余3个选项卡隐藏在“更多”选项卡中。

现在我需要一些帮助,这样当我将手机旋转到横向时,屏幕上只有4个选项卡(就像纵向模式一样),而其他6个选项卡则隐藏在“更多”选项卡中。

这个问题只出现在iOS8.3的iphone 6+上,在包括iphone6+ (IOS低于8.3)的其他iphone上,屏幕上有4个标签,其他6个标签在纵向和横向模式下都隐藏在“更多”标签中。还有一件事,如果我删除iphone6和iphone6+的启动映像,那么一切都是正常的。

EN

回答 1

Stack Overflow用户

发布于 2015-05-26 22:14:41

您可以通过设置属性@property(nonatomic,copy) NSArray *items; // get/set visible UITabBarItems. default is nil. changes not animated. shown in order来覆盖UITabBarController的缺省行为

您还可以自定义默认布局:

代码语言:javascript
复制
/*
 Default is UITabBarItemPositioningAutomatic. The tab bar items fill horizontally
 for the iPhone user interface idiom, and are centered with a default width and 
 inter-item spacing (customizable with the itemWidth and itemSpacing
 properties) for the iPad idiom. When the tab bar is owned by a UITabBarController
 further heuristics may determine the positioning for UITabBarItemPositioningAutomatic.
    Use UITabBarItemPositioningFill to force the items to fill horizontally.
    Use UITabBarItemPositioningCenter to force the items to center with a default
 width (or the itemWidth, if set).
 */
@property(nonatomic) UITabBarItemPositioning itemPositioning NS_AVAILABLE_IOS(7_0) UI_APPEARANCE_SELECTOR;

/*
 Set the itemWidth to a positive value to be used as the width for tab bar items
 when they are positioned as a centered group (as opposed to filling the tab bar).
 Default of 0 or values less than 0 will be interpreted as a system-defined width.
 */
@property(nonatomic) CGFloat itemWidth NS_AVAILABLE_IOS(7_0) UI_APPEARANCE_SELECTOR;

/*
 Set the itemSpacing to a positive value to be used between tab bar items
 when they are positioned as a centered group.
 Default of 0 or values less than 0 will be interpreted as a system-defined spacing.
 */
@property(nonatomic) CGFloat itemSpacing NS_AVAILABLE_IOS(7_0) UI_APPEARANCE_SELECTOR;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30073723

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档