Advertisement
English transcript
We're already displaying the correct image, which is this Android party
image, so there's no need to change the source attribute.
Similarly, the position isn't really incorrect.
The image just needs to be larger, so
all of these layout aligned parent attributes, we're not going to use them.
Using the id attribute in and
of itself doesn't actually make any changes to the layout.
It just give the view a name so that you can refer to it later.
Now there's actually a way to use the background attribute to achieve
the effect we're trying to achieve.
But it doesn't involve an image view.
So if you chose background, you're technically correct, but
we're going to go about it in a different way.
The way that we learned about in the lesson.
This leaves us with layout_height, layout_width, and ScaleType.
ScaleType will change the size of the image within the view box that
surrounds it.
While layout_width and
layout_height will actually change the size of that view box.
In this case, the image is large enough that the view box expands to fill
the entire screen no matter if it's wrapped content or matched parent.
Because it doesn't matter in this particular case
whether we put matched parent or
wrapped content you don't strictly need to change these, in this case.
That said, because we are trying to get the view to expand to the entire screen,
it would probably be good to set these explicitly as match parent.
Then, if we end up using a smaller image,
it will still expand to fill the entire screen.
But while layout height and layout width are sort of optional in this case,
scale type is the actual attribute that you're absolutely going to need to use
to make the image fill the entire screen.
The question is, we've chosen the attribute, but
we don't know the value to set scale type to.
And that's what I want you to figure out in the next question.
image, so there's no need to change the source attribute.
Similarly, the position isn't really incorrect.
The image just needs to be larger, so
all of these layout aligned parent attributes, we're not going to use them.
Using the id attribute in and
of itself doesn't actually make any changes to the layout.
It just give the view a name so that you can refer to it later.
Now there's actually a way to use the background attribute to achieve
the effect we're trying to achieve.
But it doesn't involve an image view.
So if you chose background, you're technically correct, but
we're going to go about it in a different way.
The way that we learned about in the lesson.
This leaves us with layout_height, layout_width, and ScaleType.
ScaleType will change the size of the image within the view box that
surrounds it.
While layout_width and
layout_height will actually change the size of that view box.
In this case, the image is large enough that the view box expands to fill
the entire screen no matter if it's wrapped content or matched parent.
Because it doesn't matter in this particular case
whether we put matched parent or
wrapped content you don't strictly need to change these, in this case.
That said, because we are trying to get the view to expand to the entire screen,
it would probably be good to set these explicitly as match parent.
Then, if we end up using a smaller image,
it will still expand to fill the entire screen.
But while layout height and layout width are sort of optional in this case,
scale type is the actual attribute that you're absolutely going to need to use
to make the image fill the entire screen.
The question is, we've chosen the attribute, but
we don't know the value to set scale type to.
And that's what I want you to figure out in the next question.