我想将 LinearLayout 的背景设置为可绘制对象。
我能以某种方式把它的角弄圆吗,因为它可以用 shape and gradient? 来完成。
主要问题是我需要重复位图以匹配 View 的大小
最佳答案
试试这个并将它作为免费添加到您的 Xml 项目中:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#dadada"/>
<corners
android:topLeftRadius="13dip"
android:topRightRadius="13dip"
android:bottomLeftRadius="13dip"
android:bottomRightRadius="13dip"/>
<stroke android:width="1dip" android:color="#ff000000"/>
</shape>
编辑:您可以在 LinearLayout 中定义一个 ImageView,然后可以将其背景设置为圆形
ImageView IV=(ImageView)findViewById(R.id.imageView);
IV.setBackgroundResource(R.drawable.round_border);
关于android - 具有重复模式的 BitmapDrawable 的圆角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14586113/