mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
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:
@ -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";
|
||||||
export * from "../tab-navigation-base/tab-strip-item";
|
export * from "../tab-navigation-base/tab-strip-item";
|
||||||
|
|
||||||
|
const maxTabsCount = 5;
|
||||||
const majorVersion = iosUtils.MajorVersion;
|
const majorVersion = iosUtils.MajorVersion;
|
||||||
const isPhone = device.deviceType === "Phone";
|
const isPhone = device.deviceType === "Phone";
|
||||||
|
|
||||||
@ -490,6 +491,9 @@ export class BottomNavigation extends TabNavigationBase {
|
|||||||
return;
|
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 controllers = NSMutableArray.alloc<UIViewController>().initWithCapacity(length);
|
||||||
const states = getTitleAttributesForStates(this);
|
const states = getTitleAttributesForStates(this);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user