Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果是放在recyclerview里面的控件,通过更新item, 因为复用,会有点问题。 #19

Closed
yxyaxng opened this issue Apr 1, 2017 · 3 comments

Comments

@yxyaxng
Copy link

yxyaxng commented Apr 1, 2017

if(badge==null){
badge = new QBadgeView(context).bindTarget(img_type);
badge.setBadgeGravity(Gravity.END | Gravity.TOP);
badge.setGravityOffset(DensityUtil.dip2px(context,6), DensityUtil.dip2px(context,6), false);
badge.setBadgePadding(3, true);
badge.setBadgeTextSize(10, true);
badge.setBadgeTextColor(context.getResources().getColor(R.color.mine_secretary_color));
badge.setBadgeBackgroundColor(Color.parseColor("#ffffff"));
}
badge.setBadgeNumber(typeBean.getMesCount());

@qstumn
Copy link
Owner

qstumn commented Apr 1, 2017

你可以参照我demo中RecyclerViewActivity中的用法,你这种写法不太好

@clunyes
Copy link

clunyes commented Apr 29, 2017

q.rorbin.badgeview.QBadgeView$BadgeContainer cannot be cast to android.widget.ImageView,不能放recycleview中用,没法刷新的

@qstumn
Copy link
Owner

qstumn commented May 2, 2017

请参照此处解决此问题 https://github.com/qstumn/BadgeView#5一些注意事项

@qstumn qstumn closed this as completed Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants