From 209a9267fee1046a1bb2c4ae536eed76b65ddd26 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 27 Nov 2019 17:03:20 +0800 Subject: [PATCH] feat:step5 --- demo/src/LayoutDemo.ts | 8 ++------ iOS/Pod/Classes/Shader/DoricScrollerNode.m | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/demo/src/LayoutDemo.ts b/demo/src/LayoutDemo.ts index 4ff2e8a1..442e2844 100644 --- a/demo/src/LayoutDemo.ts +++ b/demo/src/LayoutDemo.ts @@ -1,5 +1,5 @@ -import { Group, Panel, Text, text, gravity, Color, Stack, LayoutSpec, list, NativeCall, listItem, log, vlayout, Gravity, hlayout, slider, slideItem, scroller, IVLayout, IHLayout } from "doric"; +import { Group, Panel, Text, text, gravity, Color, Stack, LayoutSpec, list, NativeCall, listItem, log, vlayout, Gravity, hlayout, slider, slideItem, scroller, IVLayout, IHLayout, layoutConfig } from "doric"; import { O_TRUNC } from "constants"; const colors = [ @@ -453,11 +453,7 @@ class LayoutDemo extends Panel { it.space = 20 }), ).also(it => { - it.layoutConfig = { - widthSpec: LayoutSpec.WRAP_CONTENT, - heightSpec: LayoutSpec.WRAP_CONTENT, - alignment: gravity().centerX(), - } + it.layoutConfig = layoutConfig().atmost() }) .in(rootView) } diff --git a/iOS/Pod/Classes/Shader/DoricScrollerNode.m b/iOS/Pod/Classes/Shader/DoricScrollerNode.m index da6f763c..091deb79 100644 --- a/iOS/Pod/Classes/Shader/DoricScrollerNode.m +++ b/iOS/Pod/Classes/Shader/DoricScrollerNode.m @@ -45,10 +45,6 @@ - (void)layoutSelf:(CGSize)targetSize { [self setContentSize:self.contentView.frame.size]; } -- (CGSize)measureSize:(CGSize)targetSize { - CGSize size = [super measureSize:targetSize]; - return CGSizeMake(MIN(targetSize.width, size.width), MIN(targetSize.height, size.height)); -} @end @interface DoricScrollerNode ()