2015-12-04 33 views

回答

5

使XML繪製

<?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" /> 

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

</shape> 

並將此作爲繪製背景的ImageView

+2

注意:ImageView的高度必須是2 *半徑(在本例中爲20dp),以獲得所需的「完美圓形」效果。 –

0

您可以遵循Bhargav以上.xml文件建議使用形狀或層的方法(你可以找到許多指南這樣做),或者你也可以使用畢加索圖書館這樣的許多功能。畢加索讓許多事情變得容易,我建議你使用畢加索。