Let's drag an edit text into our lay out now let's instead this palette section.
Just click on text and let's select the plain text and just strike it here.
So we need to actually selected and drag it here and put it wherever you want.
For example here is good.
Right.
And this actually the slate is added text and for the size constraints here I want to change it to match
constraints so here inside this little square inside the properties window.
Just click on this.
So it's kind of strange here in order to change it to match constraint.
Now let's create a constraint to the right of the view.
OK.
So just select is a right square here.
This right square on the right edge of this text and then draw a line up.
Actually a constraint create a constraint to the right edge of the view here and then release it.
So now you can see that this constraint is created.
So let's actually change it to for example 5.
This right margin 5 and then present until January but now let's create a constraint to actually write
it.
Of these price takes few.
So just actually selectees left that the circle is on the edge of the left edge of this it takes.
And that just creates a constraint to the right edge of this.
Price takes view and then release it.
So now you can see that this constraint is actually created here.
Right.
So now I want to actually increase their top margin of this price takes you here because I want to align
the text of this text view with the text of this text.
So just select this price it takes.
And now let's increase the top margin of this tissue to change it to.
For example 30s with I think or I finished 20s with let's change it back to 20.
Now it's good.
Now let's select this edit text here and you can see this little scroll here that you can that there
are actually the letters AB is here right inside it.
Just click on it and now it's going to allow you to select this baseline constraint.
And I actually tried your constraint to this price.
I turned to the baseline constraint of this price and then just release it and I can see that the taste
of the sex is actually in alignment horizontally actually with that name.
To me they actually have the text of this edit text right.
So you can see all these constraints here.
Right.
If you want to I can hide these constraints at the top and you just click on these height constraints.
And now we can see that the constants are actually hidden.
If I click on it again now the constraints are going to be actually shown to the user.
But now I want to actually show you the inferred option here.
This one it says inferred constraints.
So let's selectees it it takes and this process takes a view.
Let's go back to designing tablets.
Select this as it takes just hold down the shift key on your keyboard and then select this price takes
view.
And now you want to actually delete the constraints of these two components so you can see it is actually
button here that you that actually the letter X is actually inside this box button inside this little
square.
If you click on it it's going to actually clear the constraint for a specific component and just click
on these two here.
Let's click on this one here also.
So in other constraints of these two user interface components but actually deleted.
So now you want to allow the Android studio to create those constraints for me.
How just select Do these to use an interface components.
And here we have this option.
It says infer constraints.
Right.
Let's click on it.
And as you can see the constraints are actually added here for me but I need to add some more constraints
here.
So for example I need to actually select this editor here and I need to actually just select the right
lead or circle on the right edge of this text and just create a constraint to the right edge of the
view.
So this is how Android studio created constraints for us.
OK.
If you want to allow Android studio to create the constraints for you you can just click on this in
our constraints right.
You can actually select all these constraints here.
I can select So inside this componentry section just select all these user interface components here
and then click on a clear constraints and you can see that all the concerns are clear clear.
Right.
And here again I can actually select all these here.
All these user interface components.
And now I can cut in further constraints.
Right.
This is how Andrew it's actually designed the user interface for me by adding to constraints.
So if you don't like that these constraints that are actually created for you you need to create the
constraints.
Actually manually right.
So that's it.
I think now you know all about creating constraints in Android.
So for example this entry to add a button to our constantly.
So inside this widget section here is just to select the spot in and just drag it here.
And for example I can put it here right if I want to I can click on in further constraints.
So now the constants are created for me or I can actually clear the constraints of the spot by just
clicking on this little button here.
And then I can create the constraints here.
So for example I can select this light circle here at the right edge of this pattern and that I get
as a constraint I can't draw a line or I can say to the right of the view actually it's actually really
sweet.
And again actually to select this.
Let's circle the red circle at the left hand side of the spot.
And create a constraint to the left of their view and really see it.
Or you can actually select these top circle of that is actually on the top edge of this button and drag
a line that I get actually constrained to the circle that is actually on the bottom of this it takes
and release it.
Right.
So here I actually created the constraints for this button so I can also change the exercise constraints
of this button salicylic disputant And inside these properties window inside this square I can click
on this a size constraint and I can change it to actually match constraints so that you can see that
it's going to take the entire width and it's also it also going to actually consider the margins.
Right.
We have the right margin and the left margin.
And if you run the application Now let me show you the emulator.
You can see that all these user interface components are actually position here.
Here for you.
So that's it.
If you have any questions about these concepts that they taught you in this lesson please post the discussion
in the course and then I do my best to answer all of your questions.
Thank you very much for watching and see the next tutorial.