Background Image Placement

You’ll have to create a custom bitmap drawable with your bitmap in an XML file (eg “res/drawables/my_drawable.xml”

<?xml version="1.0" encoding="utf-8"?>
<bitmap
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="https://stackoverflow.com/questions/2781593/@drawable/my_png_file"
    android:gravity="bottom|left" />

And then set this drawable xml as your view’s background (“@drawables/my_drawable”).
The drawable XML format is very poorly documented in the Android site, though, so it’s definitely not an easy problem to figure out how to solve on your own.

Leave a Comment