Skip to content

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

@lwlizhe

Description

@lwlizhe

推荐在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);

不知道有没有更好的方法

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