feat: add scrollsToTop for scrollable views only for iOS

This commit is contained in:
pengfei.zhou
2023-03-13 19:17:56 +08:00
committed by osborn
parent 0774df96e1
commit 7db5d68db5
30 changed files with 221 additions and 3 deletions

View File

@@ -84,6 +84,12 @@ export class FlowLayout extends Superview {
@Property
bounces?: boolean
/**
* Take effect only on iOS
*/
@Property
scrollsToTop?: boolean
@Property
canDrag?: boolean

View File

@@ -81,6 +81,12 @@ export class HorizontalList extends Superview {
@Property
bounces?: boolean
/**
* Take effect only on iOS
*/
@Property
scrollsToTop?: boolean
@Property
canDrag?: boolean
@@ -88,8 +94,8 @@ export class HorizontalList extends Superview {
* @param from
* @returns Returns the item of index which can dragged or not.
*/
@Property
itemCanDrag?: (from: number) => boolean
@Property
itemCanDrag?: (from: number) => boolean
/**
* @param from

View File

@@ -81,6 +81,12 @@ export class List extends Superview {
@Property
bounces?: boolean
/**
* Take effect only on iOS
*/
@Property
scrollsToTop?: boolean
@Property
canDrag?: boolean

View File

@@ -29,6 +29,12 @@ export class NestedSlider extends Group {
@Property
bounces?: boolean
/**
* Take effect only on iOS
*/
@Property
scrollsToTop?: boolean
addSlideItem(view: View) {
this.addChild(view)
}

View File

@@ -42,12 +42,19 @@ export class Scroller extends Superview implements JSX.ElementChildrenAttribute
@Property
scrollable?: boolean
/**
* Take effect only on iOS
*/
@Property
bounces?: boolean
/**
* Take effect only on iOS
*/
@Property
scrollsToTop?: boolean
allSubviews() {
return [this.content]
}

View File

@@ -56,6 +56,13 @@ export class Slider extends Superview {
*/
@Property
bounces?: boolean
/**
* Take effect only on iOS
*/
@Property
scrollsToTop?: boolean
/**
* Set the effect when sliding
* ZoomOut is currently supported