From 0fa35d3464a3b616bfc80613784c958152069c65 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 27 Nov 2019 20:04:24 +0800 Subject: [PATCH] feat:any view can be used to be refreshable --- demo/src/RefreshableDemo.ts | 6 ++---- js-framework/src/ui/refreshable.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/demo/src/RefreshableDemo.ts b/demo/src/RefreshableDemo.ts index 0b967c01..aff79139 100644 --- a/demo/src/RefreshableDemo.ts +++ b/demo/src/RefreshableDemo.ts @@ -35,7 +35,7 @@ class RefreshableDemo extends Panel { refreshImage.setRotation(context, rotation) }, }), - content: scroller(vlayout([ + content: (vlayout([ title("Refreshable Demo"), label('start Refresh').apply({ width: 300, @@ -99,9 +99,7 @@ class RefreshableDemo extends Panel { layoutConfig: layoutConfig().atmost().h(LayoutSpec.WRAP_CONTENT), gravity: gravity().center(), space: 10, - } as IVLayout)).apply({ - layoutConfig: layoutConfig().atmost(), - }) + } as IVLayout)) }).apply({ bgColor: Color.YELLOW }).in(rootView) diff --git a/js-framework/src/ui/refreshable.ts b/js-framework/src/ui/refreshable.ts index 556196e3..5756d40f 100644 --- a/js-framework/src/ui/refreshable.ts +++ b/js-framework/src/ui/refreshable.ts @@ -5,7 +5,7 @@ import { BridgeContext } from "../runtime/global"; import { layoutConfig } from "./declarative"; export interface IRefreshable extends IView { - content: List | Scroller + content: View header?: View onRefresh?: () => void }