VStack y HStack
Group views vertically and horizontally.
VStack y HStack
Group views vertically and horizontally.
0
0
Checkbox to mark video as read
Mark as read

If you want to place multiple elements vertically or horizontally, you can use VStack and HStack respectively.

Let's see how to place multiple texts vertically:

VStack {
    Text("Text 1")
    Text("Text 2")
    Text("Text 3")
}



Or horizontaly:

HStack {
    Text("Text 1")
    Text("Text 2")
    Text("Text 3")
}


Aligning and spacing the content

These two components can take up to two parameters, alignment and spacing. Both components have different alignments.

  • VStack: leading, center, trailing
  • HStack: top, center, bottom



course

Quiz Time!

0 Comments

Join the community to comment
Sign Up
I have an account
Be the first to comment

Accept Cookies

We use cookies to collect and analyze information on site performance and usage, in order to provide you with better service.

Check our Privacy Policy