Shape Drawable(Oval)

Posted by ITPangPang
2016. 5. 15. 15:47 Android/.xml



Shape Drawable(Oval)


(1) stroke

(2) solid

(3) size

(4) gradient

(5) padding





(1) stroke

<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#000000"
android:width="1dp"
/>
</shape>


<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#FF00FF"
android:width="5dp"
android:dashGap="5dp"
android:dashWidth="2dp"
/>

</shape>


(2) solid

<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#000000"
android:width="5dp"
android:dashGap="5dp"
android:dashWidth="2dp"
/>
<solid
android:color="#F0FF30"
/>
</shape>


(3) size

<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#000000"
android:width="1dp"
/>
<solid
android:color="#F0FF30"
/>
<size
android:width="20dp"
android:height="20dp"
/>
</shape>


(4) gradient

<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#000000"
android:width="1dp"
/>
<solid
android:color="#F0FF30"
/>
<size
android:width="20dp"
android:height="5dp"
/>
<gradient
android:startColor="#000000"
android:centerColor="#FF0000"
android:endColor="#FFFFFF"
/>
</shape>


<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#000000"
android:width="1dp"
/>
<solid
android:color="#F0FF30"
/>
<size
android:width="100dp"
android:height="50dp"
/>
<gradient
android:startColor="#000000"
android:centerColor="#FF0000"
android:endColor="#FFFFFF"
android:angle="90"
/>
</shape>


AND

(5) padding

<?xml version="1.0" encoding="UTF-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#000000"
android:width="1dp"
/>
<solid
android:color="#F0FF30"
/>
<size
android:width="100dp"
android:height="50dp"
/>
<gradient
android:startColor="#0000FF"
android:centerColor="#00FF00"
android:endColor="#FFFFFF"
android:angle="180"
/>
<padding
android:top="1dp"
android:left="1dp"
android:right="1dp"
android:bottom="1dp"
/>
</shape>


+

http://itpangpang.xyz/173

'Android > .xml' 카테고리의 다른 글

Layout Weight(Vertical)  (0) 2016.05.15
Layout Weight(Horizontal)  (0) 2016.05.15
Shape Drawable(Line)  (0) 2016.05.15
Shape Drawable(Rectangle)  (0) 2016.05.15