mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
fix(ios): scrollview safe area when no scroll (#6568)
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
</Page.actionBar>
|
||||
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<StackLayout backgroundColor="teal">
|
||||
<GridLayout height="30" backgroundColor="red" />
|
||||
<GridLayout height="30" backgroundColor="yellow" />
|
||||
<GridLayout height="30" backgroundColor="green" />
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
<GridLayout>
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<StackLayout backgroundColor="teal">
|
||||
<GridLayout height="30" backgroundColor="red" />
|
||||
<GridLayout height="30" backgroundColor="yellow" />
|
||||
<GridLayout height="30" backgroundColor="green" />
|
||||
|
@ -164,16 +164,14 @@ export class ScrollView extends ScrollViewBase {
|
||||
nativeView.contentInsetAdjustmentBehavior = 2;
|
||||
}
|
||||
|
||||
let scrollWidth = width;
|
||||
let scrollHeight = height;
|
||||
let scrollWidth = width + insets.left + insets.right;
|
||||
let scrollHeight = height + insets.top + insets.bottom;
|
||||
if (this.orientation === "horizontal") {
|
||||
scrollWidth = Math.max(this._contentMeasuredWidth + insets.left + insets.right, width);
|
||||
scrollHeight = height + insets.top + insets.bottom;
|
||||
scrollWidth = Math.max(this._contentMeasuredWidth + insets.left + insets.right, scrollWidth);
|
||||
width = Math.max(this._contentMeasuredWidth, width);
|
||||
}
|
||||
else {
|
||||
scrollHeight = Math.max(this._contentMeasuredHeight + insets.top + insets.bottom, height);
|
||||
scrollWidth = width + insets.left + insets.right;
|
||||
scrollHeight = Math.max(this._contentMeasuredHeight + insets.top + insets.bottom, scrollHeight);
|
||||
height = Math.max(this._contentMeasuredHeight, height);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user