So well come back.
Statues are a way for us to organize our different items inside a stack of items and they're actually
very very helpful in a lot of different locations so let me go to school.
I'm going to start a new project here called sativus is that we use and then I'm going to jump immediately
into the storyboard.
Now let's imagine a situation like this.
I have a button down.
But then it's going to be how more distinctive by going for it or so on.
And then I have another one next to it and the other one.
And for whatever reason I want all of them to be placed next to each other with the same gap between
them.
Obviously one way to do that would be if I go ahead to my dimensions.
I read the values and I do a lot of you know mathematical calculations place them all them and then
I start adding constructs and then there is a much easier way.
And that is using a stack for you.
So I want to go in here and say Give me a statue and I want a horizontal a side view of course I'm going
to place my view here.
Unfortunately there's no way to change its background color so you kind of have to look at it like this.
And the reason for it is the stack is essentially a what we call a non drawing view.
So it doesn't really have that draw frame.
But you could actually see it using the anchors that are it.
Now before I add any elements to it I have to set the constraints for it and when I say let's say the
height of it is always going to be let's say one hundred twenty eight.
Let's say it is going to be vertically centered in my screen.
Let's say it has a leading space of 10 of the trailing space of two or three a game.
So this is going to be always here.
I'm sorry if the four corners are not very easily detectable.
Maybe if I change the back on it would be a little bit easier to see.
So if this is like a ball didn't really have as much but but so these corners are very my style.
You are now.
I wish they could do is I could actually write my ball then drop it into it.
And then it automatically fills the whole thing.
Then there I another one and then choice two is spaced out one in and then another one.
Now let me go ahead and rename my body.
So this is by then 1 so I know what you're talking about.
This is body and tool.
And I'm going to call Dajuan to have a read thank.
And this is Padan three.
And that line has got a differing code as well.
Now a stack of yours of very simple to deal with are there are a few ways that they would essentially
distribute objects.
One of them is the mode that we currently have this is called fill up.
And then there's other mode that you usually want to use and that's called Fill equally.
So they essentially get divided equally and then you can have a space between them that say 20 pixels
or 20 units in here.
So using that you can simply set your objects to be always in this particular situation irrelevant of
the orientation because the stack is going to adjust itself I'm going to adjust its children in there.
That's one way of making a stacked views.
To be honest.
My preferred way because I had the other two sets my constraints first and then worry about the content.
There's also another way which is you would actually have a group of objects and then embed them inside
this like view.
So I'm going to go ahead and do that.
Actually let me drive the three buttons out.
So we have the table.
They're just you know randomly sitting on it.
And then I don't have the time for you anymore.
I'm going to select the three buttons and then go down here and say embed inside a side view.
And this is going to try to use its best judgment to decide whether it has to be a horizontal one or
a vertical line.
You made a mistake and that wasn't the orientation you wanted.
You could simply go ahead to the axis and say change it to a vertical challenge with this Maudie's.
Now you have to still set the constraints.
So for instance I'm going to say there's a constraint to the top and from the top is always to say 40
are on there and then I'm going to set another constraint.
Let's say at the bottom I'm going to say from the bottom is always again 40.
So that's kind of how it looks like.
And then maybe I'm going to have another one say vet.
The vet is always going to be let's say 96 and then I'm going to go ahead and say that is a leading
face as well.
So now my statue is properly adjusting itself to the top left bottom as well as having a particular
vet.
So I know that we have three items inside our stack few and a few is vertical we can actually see another
attribute of it and that's the alignment.
So if I go and change the distribution to feel equally is going to fill it equally based on the orientation
of the axis you said but the alignment effect is not going to change they're going to be using their
intrinsic value which is the value of the tend to place themselves.
For instance if my but then one had a longer text longer text would take more space than the rest of
them so I could easily go to a few and say the alignment is all so fit.
So make sure you have it both ways both in terms of the leading space and the alignment as well as the
distribution between them.
And I'm with you with a space of say 20 again.
And that's all there is to us.
Thank you.
You can see that there is going to be so many many situations very you need as each of you simply because
as night falls they allow you to have equally spaced objects or if you want to make them based on their
content proportionately or if you want to make them based on equal space between them so on and so forth
there's so many many situations where I know all the other developers.
They use a statues.
So I'll give it a shot and it's a very simple thing to use.
But you know just make sure that you have a good grasp over it.
And then we move on to our next lesson.