I want to make a screen which contains a top bar and an image. I use TextView for the top bar and ImageView for the image. I want to set padding only to the image view. My xml i
On the ImageView use
android:src="@drawable/image"
instead of
android:background="@drawable/image"
src tag honors the padding whereas background tag does not. In some cases, esp. on clickable icon, it is a bad idea to use layout_margin instead of padding, as padding belongs to the view and makes the click area bigger!.