我有 ListView ,并且我有一组连续的图像。我想为图像添加边框,这是最简单的方法。
最佳答案
将其放入名为 image_border.xml 的可绘制文件夹中
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="2dip" android:color="#8d8d8d" />
<padding
android:left="1dip"
android:top="1dip"
android:right="1dip"
android:bottom="1dip" />
<solid android:color="#000000" />
<corners android:radius="10dip" />
</shape>
并为 ImageView 使用属性 android:background="@drawable/image_border"
您可以根据需要更改形状。
关于android - 在 ListView 中放置图像边框的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11356788/