您的位置:首页 > 其它

圆角图片

2015-11-10 21:52 288 查看
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="roundedimageview">
<attr name="border_thickness" format="dimension" />
<attr name="border_inside_color" format="color" />
<attr name="border_outside_color" format="color"></attr>
</declare-styleable>
</resources>


styleable.xml

<com.archive.xunji.widgets.RoundImageView
android:id="@+id/iv_touxiang_guangchangfragment"
android:layout_alignBottom="@id/tv_username_guangchangfragment"
android:layout_toLeftOf="@id/tv_username_guangchangfragment"
android:layout_marginRight="5dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@mipmap/ic_launcher"
/>


圆形图片最主要的方法 paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));

意思是取两个元素在画布上的交集然后取上层部分显示 如此将圆形图片展示出来
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: