1. 程式人生 > >android利用shape畫半圓

android利用shape畫半圓

      在網上觀察下來,好像畫半圓的資料沒有,所以這邊提供一個畫半圓的關於shape的xml檔案。

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape = "rectangle"
    >
    <size android:height="40dp"
        android:width="80dp"/>
    <solid 
android:color = "#f74b4b" /> <corners android:bottomLeftRadius = "0dp" android:bottomRightRadius = "0dp" android:topLeftRadius = "60dp" android:topRightRadius = "60dp"/> </shape>