在我的应用程序中,我正在使用标签栏控制器,我在TabBar控制器中有10个标签,在纵向模式下,屏幕上只有4个标签可见,其余6个标签隐藏在“更多”标签中。
问题出在Iphone6+(8.3)上,当我在横向旋转手机时,隐藏在“更多”选项卡中的选项卡出来了,并且在屏幕上是可见的,这样屏幕上就可以看到7个选项卡,其余3个选项卡隐藏在“更多”选项卡中。
现在我需要一些帮助,这样当我将手机旋转到横向时,屏幕上只有4个选项卡(就像纵向模式一样),而其他6个选项卡则隐藏在“更多”选项卡中。
这个问题只出现在iOS8.3的iphone 6+上,在包括iphone6+ (IOS低于8.3)的其他iphone上,屏幕上有4个标签,其他6个标签在纵向和横向模式下都隐藏在“更多”标签中。还有一件事,如果我删除iphone6和iphone6+的启动映像,那么一切都是正常的。
发布于 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的缺省行为
您还可以自定义默认布局:
/*
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;https://stackoverflow.com/questions/30073723
复制相似问题