How to include image in Android interface?

I am creating my first Android interface and I want to enable the logo. The logo is called logo.jpg. How to do it?

+7
source share
3 answers

Place the logo in the res / drawable directory. Or, if you have different size logos, put them in res / drawable-mdpi, res / drawable-hdpi, etc. See Providing Resources for more information.

To display an image, use ImageView . XML refers to the image as follows:

android:src="@drawable/logo" 
+4
source

you can add your logo (e.g. logo.png name) to the drawable folder and then add imageView to your xml layout as follows:

 <ImageView android:id="@+id/logo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/logo" <!-- this is the drawable source of your imageView --> /> 
+2
source

Then put the image in which you want the logo to be installed and set the image resource to R.drawable.logo or what ever was the name of the resource.

0
source

All Articles