Skip to content

RecyclerView中使用会显示错位,多余空行,最后一行内容被裁剪 #57

Description

@sangsais

在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 会有多余空行 裁剪问题 ):
20180809_100427
20180809_100454

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions