App/Android

drawable : 링 모양 만들기 코드

Khookie 2020. 12. 19. 16:26

1.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring"
    android:innerRadiusRatio="3"
    android:useLevel="false">
<solid android:color="#ff0"/>
</shape>

2. 그라디엔트 링

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

    <gradient android:type="sweep" android:centerX="1" android:centerY="1"
        android:startColor="#dfa"
        android:endColor="#19f" android:centerColor="#fff"/>
</shape>