Вопрос

I'm trying to make simple button style with 100dp corner radius (working in Intellije Idea).

That's the code:

<corners android:radius="100dp"/>

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

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

<size
        android:width="110dp"
        android:height="40dp"
        />

I can't find problem... Because the target button i'm trying to change is not actually changing. It seems that the corner radius is not changing! that's my button with 100dp!!! corner radius

Это было полезно?

Решение

Try this

<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <corners 
        android:topLeftRadius="100dp"
        android:topRightRadius="100dp"
        android:bottomLeftRadius="100dp"
        android:bottomRightRadius="100dp"/>

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

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

<size
        android:width="110dp"
        android:height="40dp"
        />

</shape>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top