androiddevelop / AlignTextView

字体对齐的textview
Apache License 2.0
1.39k stars 244 forks source link

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

Open sangsais opened 5 years ago

sangsais commented 5 years ago

在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

androiddevelop commented 5 years ago

显示错位这个问题,在recyclerView中的item刷新时,调用reset方法。 截断问题,方便贴一下给AlignTextView添加的attr不?

sangsais commented 5 years ago

<me.codeboy.android.aligntextview.AlignTextView android:id="@+id/tv_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/y30" android:gravity="center_vertical" android:textColor="#333333" android:textSize="@dimen/y30" android:lineSpacingMultiplier="1.2" app:contentTextColor="#333333" app:contentTextSize="@dimen/y30" app:contentLineSpacingMultiplier="1.2" expandableTextView:maxCollapsedLines="40000" tools:text="评论主题拉克丝几点啦可视" />

leftshine commented 5 years ago

AlignTextView没有reset方法吧 CBAlignTextView才有reset方法