在TabBarController中,“更多”标签在iphone 6+ IOS 8.3上以横向模式显示

时间:2015-05-06 10:11:01

标签: uinavigationcontroller uitabbarcontroller landscape iphone-6-plus ios8.3

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

问题出现在Iphone6 +(8.3)上,当我在风景中旋转手机时,隐藏在“更多”标签中的标签会出现并在屏幕上显示,这样就可以在屏幕上看到7个标签并保留3隐藏在“更多”标签中。

现在我需要一些帮助,以便当我将手机旋转到横向时,屏幕上只剩下4个标签(如纵向模式),其他6个标签仍隐藏在“更多”标签中。

此问题仅发生在拥有IOS 8.3的iphone 6+上,包括iphone6 +在内的其他iphone上(IOS少于8.3),屏幕上显示4个标签,其他6个标签仍隐藏在“更多”标签中景观模式。还有一件事,如果我删除iphone6和iphone6 +的启动图像,那么每件事情都很好。

1 个答案:

答案 0 :(得分:0)

您可以通过设置属性UITabBarController

来覆盖@property(nonatomic,copy) NSArray *items; // get/set visible UITabBarItems. default is nil. changes not animated. shown in order的默认行为

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

/*
 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;