Java 执行getFilter时ViewHolder错误的行为

Java 执行getFilter时ViewHolder错误的行为,java,android,android-studio,android-recyclerview,Java,Android,Android Studio,Android Recyclerview,所以我想在stok尝试这种方式时将颜色设置为红色 int statuscolor = 0; if (stok <= limit) { statuscolor = Color.parseColor("#f44242"); } 我还没有测试过这段代码,请告诉我它是否有效它是否有效!但是蓝色的边界消失了。还有其他解决办法吗?我使用android:background在xml上设置边框您只需要在父布局中添加边框 int statusco

所以我想在
stok尝试这种方式时将颜色设置为红色

 int statuscolor = 0;
        if (stok <= limit) {
            statuscolor = Color.parseColor("#f44242");
        }

我还没有测试过这段代码,请告诉我它是否有效

它是否有效!但是蓝色的边界消失了。还有其他解决办法吗?我使用android:background在xml上设置边框您只需要在父布局中添加边框
 int statuscolor = 0;
        if (stok <= limit) {
            statuscolor = Color.parseColor("#f44242");
        }
holder.itemView.setBackgroundColor(statuscolor);