Skip to content

BUG 展示 不全,收起会展示多余的文字 #3

Description

@yexseven

https://rq.mbd.baidu.com/juu1zr7?f=cp&u=32aabbe137f88984https://rq.mbd.baidhttps://rq.mbd.baidu.com/juu1zr7?f=cp&u=32aabbe137f88984u.com/juu1zr7?f=cp&u=32aabbe137f88984https://rq.mbd.baidu.com/juu1zr7?f=cp&u=32aabbe137f88984

这一段放在 ExpandableTextView 会出现问题
第一最后 全文展示不全
展开后 点击收起 ExpandableTextView 会跳动并且第一次点击收起的时候 会展示 多余的行 收不起来,我调试了一下 搞不定 应该是边界判断出问题了 求 fix bug

while (tempLayout.getLineCount() > maxLines) {
int lastSpace = mCloseSpannableStr.length() - 1;
if (lastSpace == -1) {
break;
}
if (originalText.length() <= lastSpace) {
mCloseSpannableStr = charSequenceToSpannable(originalText);
} else {
mCloseSpannableStr = charSequenceToSpannable(originalText.subSequence(0, lastSpace));
}
tempText2 = charSequenceToSpannable(mCloseSpannableStr).append(ELLIPSIS_STRING);
if (mOpenSuffixSpan != null) {
tempText2.append(mOpenSuffixSpan);
}
tempLayout = createStaticLayout(tempText2);

            }

我放在 ExpandableTextView 里面这段 有6行 不走这个方法
但是 放6行中文进去没一点问题
微信图片_20191016142433

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