feat:Scroller add scrollTo method

This commit is contained in:
pengfei.zhou
2020-03-03 13:10:35 +08:00
committed by osborn
parent 2927ad5679
commit 46255632ec
12 changed files with 92 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
import { Superview, View, IView, NativeViewModel } from '../ui/view';
import { BridgeContext } from '../runtime/global';
export declare function scroller(content: View, config?: IScroller): Scroller;
export interface IScroller extends IView {
content?: View;
@@ -7,4 +8,8 @@ export declare class Scroller extends Superview implements IScroller {
content: View;
allSubviews(): View[];
toModel(): NativeViewModel;
scrollTo(context: BridgeContext, offset: {
x: number;
y: number;
}, animated?: boolean): Promise<any>;
}

View File

@@ -34,4 +34,7 @@ export class Scroller extends Superview {
this.dirtyProps.content = this.content.viewId;
return super.toModel();
}
scrollTo(context, offset, animated) {
return this.nativeChannel(context, "scrollTo")({ offset, animated });
}
}