반쪽짜리 원 모양이 필요할때가 있다.

drawable 에 xml 파일을 생성하고 아래를 참고해서 작성한다.

 

width, height 반원의 방향에 따라 적절히 크기를 조절

 

<corners> 태그에서 

topLeftRadius 왼쪽 상단 둥글게

topRightRadius 오른쪽 상단 둥글게

bottomLeftRadius 왼쪽 하단 둥글게

bottomRightRadius 오른쪽 하단 둥글게

 

수정하면서 모양을 보면 쉽게 할 수 있다.

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/red"/>
    <size
        android:width="5dp"
        android:height="10dp"/>
    <corners
        android:bottomRightRadius="20dp"
        android:topRightRadius="20dp"/>
</shape>

 

 

Posted by Lumasca
,