Hi everyone in this tutorial I want to talk about using images in our tap host.
So as you can see here I already talked about using a tap host in your projects and are not actually
app 46 project I told you how to use Paphos but I didn't tell you how to actually use images instead
of text in order to use for your taps.
OK.
So here in your main activity class where you actually specify the indicator for your speed.
For example here I am actually creating a top host object and then here I am setting setting up this
tap host get local activity manager.
And here I want to specify the tap host one.
OK tap one.
So tap tap tap spek.
So here I am creating an object of type speech tab space as you can see here and here I am said specifying
that tab host does not have spirit 1 so this value here in say that inside the double quotes is the
tack.
OK.
But here are the most important line of code here is line 26 where I am actually specifying the indicator
for my spec.
So spec that set indicator tap 1.
So let me you to delete this piece of code here.
And again I can just type in that set indicator.
So as you can see here we have free kinds of methods.
The first one actually accepts a value of type chart sequence again which is actually the same as string
and a value of type triable where I can actually specify an image inside my triable folder.
And the second method is set indicator as you can see this method actually accepts only one argument.
And here we can specify the title of our tap and this if it actually accepts only one argument and the
data type of the argument is view.
But here we want to actually use this if it's set indicator a label an icon.
So if we actually click on these Mefford here and as you can see here now for I want to actually use
images instead of a titles for my tabs.
So for the title I just don't want to use titles so in order for use in actually titel I just need to
assign the value empty stream.
Ok just to double quotes come up.
And for my second argument and here let me actually show you in my project structure inside my triable
folder I have some images.
OK.
So you can actually use these images in your addressable folder bear beard or cat.
And here I can just referred to those images.
So how do I refer to that triable folder image inside my resources so here I can just type in get resources
that get triable as you can see here we have these Misfit's here get triable And here inside it Prentice's
of this get thrown Hebel Meffert.
I can just type in our thoughts triable that bear aren't here at the end of our statement I need to
actually put in a semi-colon.
So now let's actually run our project and see what happens.
So as you can see here now our application is running on this emulator.
And here we can see this image here.
OK.
So now I have to actually specify an image for these two taps tap to and tap free.
So here I can just scroll down and here in this line of code that I am actually specifying the indicator
of this spec I can just delete this text here.
I just need to put in an empty string value comma.
And here I can just type in get resources that get triable and inside the apprentice's of this triable
Meffert get the global Meffert.
I can just type in our DOT ID or that are triable dot chat.
OK so now let's actually run our project again and see what happens.
So now as you can see our application is running on this emulator and here I have this image for my
second tabouli out as you can see here I have image instead of text.
OK.
So it is really important that you actually assign an empty string value here for your first argument
of this set indicator met Meffert.
OK.
If we actually assign a value here and if we run my project now let's see what happens.
So now as you can see our application is running on the simulator.
And here instead of image I can see this value that I assigned for this string value here.
OK for this first argument.
So it is very important that you assign an end an empty string value.
So here again I want to actually specify an image for this to have free.
So here I can just assign an empty string value for this set indicator.
And then comma.
And here again just typing get resources dot get tribal art that I ordered triable dot Chao our thoughts
Roybal dot let me see what images we have here because I have this image so I can just type in bird
and now let's actually done our project here and see what happens.
So now as you can see I have these images here for my Tapps.
I have this image this bird image for my first job.
We have this chat image for my second tab and I have this image for my efforts there.
OK.
So hopefully that makes sense.
And I think that's enough for this tutorial so if you have any questions please put the discussion in
the course and then I do my best to answer all of your questions.
Thank you very much for watching and I'll see you in the next tutorial.