-
Notifications
You must be signed in to change notification settings - Fork 243
Open
Description
在RecyclerView中使用AlignTextView,会出现item显示错乱(假如列表为空,动态添加第一条正常,不会错乱,大于等于一条数据后,再做一次动态添加,显示位置就乱了),最后一行被裁减,最后一行会多出一行空行
implementation 'me.codeboy.android:align-text-view:2.3.2'
出现机型,红米note4 Samsung nexus6p 华为 vivo OPPO 魅族 系统版本(5.0-8.1都有)
adapter中给AlignTextView赋值使用代码如下:
AlignTextView replyTextView = helper.getView(R.id.tv_reply);
SpannableStringBuilder spannableString = new SpannableStringBuilder();
spannableString.append("专家回复:").append(replyText);
StyleSpan styleSpan = new StyleSpan(Typeface.BOLD);//粗体
spannableString.setSpan(styleSpan, 0, 5, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
replyTextView.setText(spannableString);
运行截图(截图里用户的提问已经改用TextView, 错位问题解决,但是专家回复字样的内容使用的AlignTextView 会有多余空行 裁剪问题 ):
Metadata
Metadata
Assignees
Labels
No labels