1

I have the following XML, which I use as a splash screen theme:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:opacity="opaque">
    <item android:drawable="@color/colorPrimary" />
    <item
        android:drawable="@drawable/ic_splash"
        android:gravity="center" />
</layer-list>

According to the gravity value, the drawable is centered on the screen both horizontally and vertically. But I would like to center it only horizontally, and move it somewhat lower around the 2:1 ratio.

Is it possible to set the gravity to a custom value, or any other way?

Nekomajin42
  • 638
  • 1
  • 6
  • 20

0 Answers0