Merge pull request #7534 from NativeScript/djenkov/limit-bottom-navigation-items

feat(bottom-navigation-ios): limit bottom to 5 items
This commit is contained in:
Svetoslav
2019-07-24 14:10:26 +03:00
committed by GitHub

View File

@ -21,6 +21,7 @@ export * from "../tab-navigation-base/tab-navigation-base";
export * from "../tab-navigation-base/tab-strip";
export * from "../tab-navigation-base/tab-strip-item";
const maxTabsCount = 5;
const majorVersion = iosUtils.MajorVersion;
const isPhone = device.deviceType === "Phone";
@ -490,6 +491,9 @@ export class BottomNavigation extends TabNavigationBase {
return;
}
// Limit both tabContentItems and tabStripItems to 5 in order to prevent iOS 'more' button
items = items.slice(0, maxTabsCount);
const controllers = NSMutableArray.alloc<UIViewController>().initWithCapacity(length);
const states = getTitleAttributesForStates(this);