String titlebig=data.getNickname().toUpperCase();
String keywordbig=keywords.toUpperCase();
int indexOf = titlebig.indexOf(keywordbig);
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#E10000")), indexOf, indexOf + keywords.length(), SPAN_EXCLUSIVE_EXCLUSIVE);
txt .setText(builder);
android 文字高亮,不去区分大小写
最新推荐文章于 2022-08-12 18:49:31 发布