Advertisement
English transcript
Okay.
We gave you a link to the XML Visualizer with this initial layout.
>From the device preview we can see that Natalie, Kagure and
Amy are positioned incorrectly.
First let's try to position Kagure in the right place.
She should be located to the right of Ben and
aligned to the top of the parent.
So I'm going to search the XML for the Kugare TextView.
Here it is.
Currently it's aligned to the parent top which is correct.
But this is incorrect, we don't want to align her to the parent's right edge.
Instead we want to position her to the right of the Ben TextView.
So now she's located to the right of Ben.
Notice that I use @id/ben_text_view.
There's no plus symbol because the Ben TextView ID was already created up here.
Next, let's position Natalie.
She should be located above Lyla and along the left edge of the parent.
Here's the Natalie TextView.
It's located by default on the top left corner of the parent.
Let's move her so that's she's located above the Lyla TextView.
And the reason why I use this name is because it was defined as Lyla's view ID
name up here.
Okay, great, so Kunal, Ben and Kagure are positioned correctly now.
And so are Natalie, Lyla and me.
Next we just need to move Amy from here over to here, so
that she's above the Omoju TextView.
Here's the Amy TextView.
Currently she's aligned to the parent bottom.
But instead we want to align her to the right edge of the parent.
So, let's change that.
Then we want to position her above the Omoju TextView.
The reason why we know to use this ID is because it was defined as the ID for
the Omoju TextView.
Cool and now it's in the right place.
We gave you a link to the XML Visualizer with this initial layout.
>From the device preview we can see that Natalie, Kagure and
Amy are positioned incorrectly.
First let's try to position Kagure in the right place.
She should be located to the right of Ben and
aligned to the top of the parent.
So I'm going to search the XML for the Kugare TextView.
Here it is.
Currently it's aligned to the parent top which is correct.
But this is incorrect, we don't want to align her to the parent's right edge.
Instead we want to position her to the right of the Ben TextView.
So now she's located to the right of Ben.
Notice that I use @id/ben_text_view.
There's no plus symbol because the Ben TextView ID was already created up here.
Next, let's position Natalie.
She should be located above Lyla and along the left edge of the parent.
Here's the Natalie TextView.
It's located by default on the top left corner of the parent.
Let's move her so that's she's located above the Lyla TextView.
And the reason why I use this name is because it was defined as Lyla's view ID
name up here.
Okay, great, so Kunal, Ben and Kagure are positioned correctly now.
And so are Natalie, Lyla and me.
Next we just need to move Amy from here over to here, so
that she's above the Omoju TextView.
Here's the Amy TextView.
Currently she's aligned to the parent bottom.
But instead we want to align her to the right edge of the parent.
So, let's change that.
Then we want to position her above the Omoju TextView.
The reason why we know to use this ID is because it was defined as the ID for
the Omoju TextView.
Cool and now it's in the right place.