mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 01:43:14 +08:00
feat(tabs): respect iosOverflowSafeArea value
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
<Page class="page" >
|
||||
<Label text="Inner label 1" backgroundColor="blue"/>
|
||||
</Page>
|
||||
<GridLayout rows="*, auto">
|
||||
<Label text="Inner label 1" backgroundColor="blue"/>
|
||||
|
||||
<Label text="Inner Bottom label 1"
|
||||
textAlignment="center"
|
||||
verticalAlignment="middle"
|
||||
padding="10"
|
||||
backgroundColor="crimson"
|
||||
row="1"/>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
|
24
apps/ui/src/tabs/frame-in-tabs-overflow.xml
Normal file
24
apps/ui/src/tabs/frame-in-tabs-overflow.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<Page class="page">
|
||||
<StackLayout>
|
||||
<Tabs iosOverflowSafeArea="true" highlightColor="red" offscreenTabLimit="1" automationText="tabNavigation">
|
||||
<TabStrip highlightColor="green" itemTap="onItemTap">
|
||||
<TabStripItem title="1"></TabStripItem>
|
||||
<TabStripItem title="2"></TabStripItem>
|
||||
<TabStripItem title="3"></TabStripItem>
|
||||
<TabStripItem title="4"></TabStripItem>
|
||||
</TabStrip>
|
||||
<TabContentItem>
|
||||
<Frame defaultPage="tabs/frame-in-tabs-inner-page-1"></Frame>
|
||||
</TabContentItem>
|
||||
<TabContentItem>
|
||||
<Frame defaultPage="tabs/frame-in-tabs-inner-page-2"></Frame>
|
||||
</TabContentItem>
|
||||
<TabContentItem>
|
||||
<Frame defaultPage="tabs/frame-in-tabs-inner-page-3"></Frame>
|
||||
</TabContentItem>
|
||||
<TabContentItem>
|
||||
<Frame defaultPage="tabs/frame-in-tabs-inner-page-4"></Frame>
|
||||
</TabContentItem>
|
||||
</Tabs>
|
||||
</StackLayout>
|
||||
</Page>
|
@ -31,6 +31,7 @@ export function loadExamples() {
|
||||
examples.set('nested-bottom-navigation', 'tabs/nested-bottom-navigation-page');
|
||||
examples.set('custom-tabstrip', 'tabs/custom-tabstrip-page');
|
||||
examples.set('frame-in-tabs', 'tabs/frame-in-tabs');
|
||||
examples.set('frame-in-tabs-overflow', 'tabs/frame-in-tabs-overflow');
|
||||
examples.set('item-color', 'tabs/item-color-page');
|
||||
examples.set('dynamic-color-change', 'tabs/dynamic-color-change-page');
|
||||
|
||||
|
@ -172,15 +172,16 @@ class UIPageViewControllerImpl extends UIPageViewController {
|
||||
safeAreaInsetsTop = this.topLayoutGuide.length;
|
||||
}
|
||||
|
||||
let conditionalSafeAreaBottom = owner.iosOverflowSafeArea ? safeAreaInsetsBottom : 0;
|
||||
let scrollViewTop = 0;
|
||||
let scrollViewHeight = this.view.bounds.size.height;
|
||||
let scrollViewHeight = this.view.bounds.size.height + conditionalSafeAreaBottom;
|
||||
|
||||
if (owner.tabStrip) {
|
||||
const tabBarHeight = this.tabBar.frame.size.height;
|
||||
let tabBarTop = safeAreaInsetsTop;
|
||||
|
||||
scrollViewTop = tabBarHeight;
|
||||
scrollViewHeight = this.view.bounds.size.height - tabBarHeight;
|
||||
scrollViewHeight = this.view.bounds.size.height - tabBarHeight + conditionalSafeAreaBottom;
|
||||
|
||||
const tabsPosition = owner.tabsPosition;
|
||||
if (tabsPosition === 'bottom') {
|
||||
|
Reference in New Issue
Block a user