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>