feat:Scroller add contentOffset property

This commit is contained in:
pengfei.zhou
2020-03-03 13:23:06 +08:00
committed by osborn
parent 46255632ec
commit 6d7562877e
12 changed files with 314 additions and 265 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Superview, View, IView, NativeViewModel } from '../ui/view'
import { Superview, View, IView, NativeViewModel, Property } from '../ui/view'
import { layoutConfig } from '../util/layoutconfig'
import { BridgeContext } from '../runtime/global'
@@ -31,11 +31,15 @@ export function scroller(content: View, config?: IScroller) {
export interface IScroller extends IView {
content?: View
contentOffset?: { x: number, y: number }
}
export class Scroller extends Superview implements IScroller {
content!: View
@Property
contentOffset?: { x: number, y: number }
allSubviews() {
return [this.content]
}