triniwiz / nativescript-plugins

Apache License 2.0
80 stars 50 forks source link

Yoga the height of the first View within a StackLayout does not respect height #58

Closed vallemar closed 3 years ago

vallemar commented 3 years ago

The height of the first view within a StackLayout does not respect the height. It is set 600 like the StackLayout but looks much smaller

<StackLayout height="600" style="background-color: green">
      <View
        style="
        flex: 1;
        width: 500,
        height: 600,
        align-items: flex-start;
        padding: 20;
        background: black
      "
      >
        <View style="flex: 1; width: 10; height: 100; background: red" />
        <View
          style="
            flex: 1;
            width: 10;
            height: 100;
            background: blue;
          "
        />
      </View>
    </StackLayout>

It looks like this image

And it should look like this image

triniwiz commented 3 years ago

You have the style syntax is not valid you have


        flex: 1;
        width: 500,
        height: 600,
        align-items: flex-start;
        padding: 20;
        background: black

What you need


        flex: 1;
        width: 500;
        height: 600;
        align-items: flex-start;
        padding: 20;
        background: black
vallemar commented 3 years ago

Sorry @triniwiz , removing that the behavior disappears. What a fool