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中划出界面不能正常显示 #23

Open
yangyeefeng opened this issue Jan 16, 2019 · 1 comment
Open

recyclerview中划出界面不能正常显示 #23

yangyeefeng opened this issue Jan 16, 2019 · 1 comment

Comments

@yangyeefeng
Copy link

设置最大行数后,在recyclerview划出界面时,不足最大行数时也会显示展开。

@fanmingyi
Copy link

fanmingyi commented Sep 16, 2019

(1)当文本或者view宽度变化,
(2)view未测量时导致无法获取内部layout导致宽度为0
解决方法:
添加如下方法

  public void setJZText(CharSequence msg) {
        mOrigText = msg;
        if (getWidth() == 0 || getMeasuredWidth() == 0) {
            postDelayed(() -> {
                setJZText(msg);
            }, 50);
        } else {
            setText(getNewTextByConfig());
        }


    }

修改如下两个方法

 
    public void updateForRecyclerView(CharSequence text, int futureTextViewWidth, int expandState) {
        mFutureTextViewWidth = futureTextViewWidth;
        mCurrState = expandState;
        setJZText(text);
    }


    @Override
    public void setText(CharSequence text, BufferType type) {
//        mOrigText = text;
        mBufferType = type;

        super.setText(text, type);
    }

公司位于广州扩展B端欢迎各位大神私信自荐,入职送价值6万6的软件

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

2 participants