0

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

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

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

此问题仅在具有 IOS 8.3 的 iphone 6+ 上发生,在包括 iphone6+(IOS 低于 8.3)在内的其他 iphone 上,屏幕上可见 4 个选项卡,而其他 6 个选项卡在纵向和横向模式下仍隐藏在“更多”选项卡中。还有一件事,如果我删除了 iphone6 和 iphone6+ 的启动图像,那么一切都很好。

4

1 回答 1

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;
于 2015-05-26T14:14:41.333 回答