Android 設置圓角圖片 -自定義任意角爲圓角

UI設計的圖片效果爲 頂部兩個角爲圓角  底部兩個角爲直角

圖片

經過嘗試   終於解決啦,解決思路提供一下

1. 使用BezelImageView

2.屬性添加

app:maskDrawable="@drawable/rectangle_mask"

3.創建drawable    rectangle_mask

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#000" />
    <corners android:topLeftRadius="4dp"
        android:topRightRadius="4dp"
     />
</shape>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章