mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: delete isContentScrollable function
BREAKING CHANGES: The `scrollableContent` property is no more - use `iosExpandSafeArea` instead.
This commit is contained in:
committed by
Martin Yankov
parent
351d78e80c
commit
f40d6c1a97
1
tns-core-modules/ui/core/view/view.d.ts
vendored
1
tns-core-modules/ui/core/view/view.d.ts
vendored
@@ -798,7 +798,6 @@ export namespace ios {
|
|||||||
* @param view The view form which to start the search.
|
* @param view The view form which to start the search.
|
||||||
*/
|
*/
|
||||||
export function getParentWithViewController(view: View): View
|
export function getParentWithViewController(view: View): View
|
||||||
export function isContentScrollable(controller: any /* UIViewController */, owner: View): boolean
|
|
||||||
export function updateAutoAdjustScrollInsets(controller: any /* UIViewController */, owner: View): void
|
export function updateAutoAdjustScrollInsets(controller: any /* UIViewController */, owner: View): void
|
||||||
export function updateConstraints(controller: any /* UIViewController */, owner: View): void;
|
export function updateConstraints(controller: any /* UIViewController */, owner: View): void;
|
||||||
export function layoutView(controller: any /* UIViewController */, owner: View): void;
|
export function layoutView(controller: any /* UIViewController */, owner: View): void;
|
||||||
|
|||||||
@@ -659,21 +659,7 @@ export namespace ios {
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isContentScrollable(controller: UIViewController, owner: View): boolean {
|
|
||||||
let scrollableContent = (<any>owner).scrollableContent;
|
|
||||||
if (scrollableContent === undefined) {
|
|
||||||
const view: UIView = controller.view.subviews.count > 0 ? controller.view.subviews[0] : null;
|
|
||||||
if (view instanceof UIScrollView) {
|
|
||||||
scrollableContent = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return scrollableContent === true || scrollableContent === "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
export function updateAutoAdjustScrollInsets(controller: UIViewController, owner: View): void {
|
export function updateAutoAdjustScrollInsets(controller: UIViewController, owner: View): void {
|
||||||
const scrollable = isContentScrollable(controller, owner);
|
|
||||||
|
|
||||||
if (majorVersion <= 10) {
|
if (majorVersion <= 10) {
|
||||||
owner._automaticallyAdjustsScrollViewInsets = false;
|
owner._automaticallyAdjustsScrollViewInsets = false;
|
||||||
// This API is deprecated, but has no alternative for <= iOS 10
|
// This API is deprecated, but has no alternative for <= iOS 10
|
||||||
|
|||||||
Reference in New Issue
Block a user