在ImageView中显示图像的边框

时间:2017-07-17 11:16:50

标签: android image

如何在图像视图内显示边框到图像,我希望在图像的侧面和底部完成类似于箭头的线条,以显示线条上方文本的长度和宽度。我已经提过了 Is there an easy way to add a border to the top and bottom of an Android View?Border for an Image view in Android? 但是这两个都为图像视图创建了一个边框,而我需要一个边框用于图像本身。

1 个答案:

答案 0 :(得分:0)

如果你想在imageview周围边框,你可以尝试这个

您可以使用CirlcleImageView库来舍入ImageView

编译此libray

compile 'de.hdodenhof:circleimageview:2.1.0'

在布局中使用如下所示

 <de.hdodenhof.circleimageview.CircleImageView
   xmlns:app="http://schemas.android.com/apk/res-auto"
   android:id="@+id/profile_image"
   android:layout_width="96dp"
   android:layout_height="96dp"
   android:src="@drawable/profile"
   app:civ_border_width="2dp"
   app:civ_border_color="#FF000000"/>

了解更多信息,请点击this link enter image description here

相关问题