Dries Cleymans
Dries Cleymans

Reputation: 890

NativeScript StackLayout with gap between child elements

I'm using the NativeScript StackLayout component to layout my elements.

What is the best approach to create a gap between the child elements of a StackLayout?

Upvotes: 3

Views: 3105

Answers (1)

Nicu Surdu
Nicu Surdu

Reputation: 8321

You can use margin in the css for that layout.

In you XML:

  <StackLayout>
      <Label text="Hey there,"></Label>
      <Label text="world!"></Label>
  </StackLayout>

In your css:

StackLayout Label {
  margin: 10;
}

Upvotes: 7

Related Questions