mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(scroll-view): apply insets to layoutChild method
Delete `*-nav-page.*` files reproducing the issue. Update `home-page.xml` with `ScrollView` to reproduce the issue.
This commit is contained in:
committed by
Martin Yankov
parent
a1d240786f
commit
52f8e67203
@@ -4,12 +4,14 @@
|
|||||||
<Label class="action-bar-title" text="Home"></Label>
|
<Label class="action-bar-title" text="Home"></Label>
|
||||||
</ActionBar>
|
</ActionBar>
|
||||||
|
|
||||||
|
<ScrollView>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<Button text="Component Examples" tap="onNavigate" route="component/component-page"></Button>
|
<Button text="Component Examples" tap="onNavigate" route="component/component-page"></Button>
|
||||||
<Button text="GridLayout Examples" tap="onNavigate" route="gridlayout/gridlayout-page"></Button>
|
<Button text="GridLayout Examples" tap="onNavigate" route="gridlayout/gridlayout-page"></Button>
|
||||||
<Button text="ScrollView Examples" tap="onNavigate" route="scrollview/scrollview-page"></Button>
|
<Button text="ScrollView Examples" tap="onNavigate" route="scrollview/scrollview-page"></Button>
|
||||||
<Button text="ListView Examples" tap="onNavigate" route="listview/listview-page" />
|
<Button text="ListView Examples" tap="onNavigate" route="listview/listview-page" />
|
||||||
<Button text="WrapLayout Examples" tap="onNavigate" route="wraplayout/wraplayout-page"></Button>
|
<Button text="WrapLayout Examples" tap="onNavigate" route="wraplayout/wraplayout-page"></Button>
|
||||||
<Button text="Navigation" tap="onNavigate" route="wraplayout/no-action-bar/hwrap-nav-page"></Button>
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<Page class="page"
|
|
||||||
xmlns="http://schemas.nativescript.org/tns.xsd">
|
|
||||||
|
|
||||||
<ScrollView orientation="vertical">
|
|
||||||
<WrapLayout orientation="horizontal">
|
|
||||||
<Button text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet" backgroundColor="green"></Button>
|
|
||||||
<Button text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet"></Button>
|
|
||||||
<Button text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet"></Button>
|
|
||||||
<Button text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet"></Button>
|
|
||||||
</WrapLayout>
|
|
||||||
</ScrollView>
|
|
||||||
</Page>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { View, EventData } from "tns-core-modules/ui/core/view/view";
|
|
||||||
import * as frame from "tns-core-modules/ui/frame";
|
|
||||||
|
|
||||||
export function onNavigate(args: EventData) {
|
|
||||||
const view = args.object as View;
|
|
||||||
const route = view["route"];
|
|
||||||
|
|
||||||
// view.page.frame.navigate(route);
|
|
||||||
frame.topmost().navigate(route);
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
|
|
||||||
xmlns:fragments="wraplayout/fragments" actionBarHidden="true">
|
|
||||||
|
|
||||||
<WrapLayout orientation="horizontal" backgroundColor="LightGreen">
|
|
||||||
<Button text="Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet"
|
|
||||||
backgroundColor="Green" tap="onNavigate" route="scrollview/action-bar/vscroll-hwrap-nav-page"></Button>
|
|
||||||
<Button text="H" backgroundColor="Pink"></Button>
|
|
||||||
</WrapLayout>
|
|
||||||
|
|
||||||
</Page>
|
|
||||||
@@ -186,7 +186,7 @@ export class ScrollView extends ScrollViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nativeView.contentSize = CGSizeMake(layout.toDeviceIndependentPixels(width), layout.toDeviceIndependentPixels(height));
|
nativeView.contentSize = CGSizeMake(layout.toDeviceIndependentPixels(width), layout.toDeviceIndependentPixels(height));
|
||||||
View.layoutChild(this, this.layoutView, 0, 0, width, height);
|
View.layoutChild(this, this.layoutView, insets.left, insets.top, width, height);
|
||||||
|
|
||||||
// if (this.orientation === "horizontal") {
|
// if (this.orientation === "horizontal") {
|
||||||
// nativeView.contentSize = CGSizeMake(layout.toDeviceIndependentPixels(this._contentMeasuredWidth + insets.left + insets.right), layout.toDeviceIndependentPixels(height));
|
// nativeView.contentSize = CGSizeMake(layout.toDeviceIndependentPixels(this._contentMeasuredWidth + insets.left + insets.right), layout.toDeviceIndependentPixels(height));
|
||||||
|
|||||||
Reference in New Issue
Block a user