Skip to content Skip to sidebar Skip to footer

Android: Background Image / ImageView For Different Screens

I want to set a background image to my Activity. I am just using an imageView in a relative Layout and position the other elements as I want them. Now we have a million, or at leas

Solution 1:

Just set your image view android:scaleType="center" and it won't scale or stretch.

Have a look at the scaleType options at the following link. This gives you a decent amount of control over how an image is rendered. http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

Also have a look at the following link. You can provide resources with the same file names in different folders, and the system will choose the most appropriate. This way, you can know more or less what size screen you are targeting with each image and you can create your images at a size that will perform the least cropping (or possibly no cropping at all). http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources


Post a Comment for "Android: Background Image / ImageView For Different Screens"