Karthik Andhamil
Karthik Andhamil

Reputation: 856

Android: shape corners radius does not work on tablet

I need a rounded corner on top left and top bottom corners. So I have the shape xml that is set to the button as background.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >

<solid android:color="@color/footer_bg_normal" />

<padding
    android:bottom="10dp"
    android:left="10dp"
    android:right="10dp"
    android:top="10dp" />

<corners
    android:bottomLeftRadius="0dp"
    android:bottomRightRadius="0dp"
    android:topLeftRadius="20dp"
    android:topRightRadius="20dp" />

</shape>

This works as expected on my phone (Nexus 4)enter image description here

But on a tablet it does not work. enter image description here

However if I remove all the attributes of corners tag and add only the generic radius (for all the corners), it works. But it has rounded corners on all 4.

android:radius="20dp"

Does anyone have idea, why is this happening? And how can i achieve only top left and top right rounded corners for all the devices?

If this is a known issue in Android, is there any work around?

Upvotes: 1

Views: 1365

Answers (1)

danysz
danysz

Reputation: 628

On which versions of Android (API) are you trying to do the things ?

There were some issues with the corners : here and here

Upvotes: 1

Related Questions