int color=getColor(item.laiBank);// 自定颜色
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
helper.getView(R.id.rl_content).setBackground(ContextCompat.getDrawable(BankCardActivity.this,R.drawable.shape_top_radius));
} else {
helper.getView(R.id.rl_content).setBackgroundDrawable(ContextCompat.getDrawable(BankCardActivity.this, R.drawable.shape_top_radius));
}
GradientDrawable myGrad = (GradientDrawable)helper.getView(R.id.rl_content).getBackground();
myGrad.setColor(color);
//自定义shape shape_top_radius
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners
android:topLeftRadius="8dp"
android:topRightRadius="8dp"
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp"/>
<solid
android:color="#00000000"/>
</shape>