我想给一个image弄成圆的,圆角可以用shape.xml实现,但是我还想用一张图片做背景,但是background只能引用一个drawable,然后我上ps把图片修成了圆的,但是放手机上仔细看会看出锯齿的感觉,咋解决shaper和背景图的问题呢
<com.makeramen.roundedimageview.RoundedImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/dsadasd"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:src="@drawable/class111"
app:civ_border_color="#FF000000"
app:riv_border_width="@dimen/dp_10"
app:riv_corner_radius="@dimen/dp_10"
app:riv_mutate_background="true"
app:riv_oval="true"
app:riv_tile_mode="repeat"
app:riv_tile_mode_x="repeat" />
用开源开源框架去完成吧,它通过布尔运算得出圆角图片。你不是矢量图,如果拉伸了,会有锯齿的。
https://github.com/vinc3m1/RoundedImageView