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

如果字数比较少,隐藏展开图标比较好吧 #4

Open
lwlizhe opened this issue Sep 6, 2017 · 0 comments
Open

如果字数比较少,隐藏展开图标比较好吧 #4

lwlizhe opened this issue Sep 6, 2017 · 0 comments

Comments

@lwlizhe
Copy link

lwlizhe commented Sep 6, 2017

推荐在mContentView.setLayoutParams(layoutParams)那段前加个判断,判断是不是需要mContentView设置位最小行数的高度,在setContent的时候加个展开图标的隐藏判断,毕竟有时候服务器返回的数据没那么多。

我这现在是这么改了下setContent:

    mShowMore.setVisibility(getMaxMeasureHeight() <= getMinMeasureHeight() ? GONE : VISIBLE);

    if(getMaxMeasureHeight()>=getMinMeasureHeight()){
        ViewGroup.LayoutParams layoutParams = mContentView.getLayoutParams();
        layoutParams.height = getMinMeasureHeight();
        mContentView.setLayoutParams(layoutParams);
    }
    同时去掉了init中的mContentView.setLayoutParams(layoutParams);

不知道有没有更好的方法

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

1 participant