Background of layout doesn't appear to render correctly on Tablet device, while render perfectly on mobile phone

26 Views Asked by At

This is the xml of the background drawable. In phone render perfectly, in tablet didn't. This drawable was used for a background in tablayout.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:bottom="10dp"
        android:left="50dp"
        android:right="50dp"
        android:top="10dp">

        <shape android:shape="rectangle">
            <solid android:color="#E3EBF2" />
            <corners android:radius="30dp" />
        </shape>

    </item>
</layer-list>
1

There are 1 best solutions below

0
laggyPC On

It was because of the "layer-list" it somehow failed to render on tablet, solution: remove the layer-list, put only shape.

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
        <solid android:color="#F2E3EBF2" />
        <corners android:radius="30dp" />
</shape>