1

This is the drawable file :

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
  <item>
    <color android:color="#ffffffff"/>
  </item>
  <item>
    <bitmap android:gravity="top|center_horizontal"
            android:src="@drawable/splash_screen"/>
  </item>
</layer-list>

I want the bitmap to have 20px margin-top, I didn't find how to set margin-top to bitmaps element

VahidHoseini
  • 495
  • 2
  • 10
  • 28
zeus
  • 12,173
  • 9
  • 63
  • 184

1 Answers1

1

You can try with android:top.

The top offset in pixels.

    <item
        android:top="20dp">
         <bitmap android:gravity="top|center_horizontal"
         android:src="@drawable/splash_screen"/>

    </item>
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198