Skip to content

I think when the child‘s width is wrap_content we should add a condition,so the Measure mode is AT_MOST for child  #32

@JackLeeMing

Description

@JackLeeMing
        if(lp.width == LayoutParams.MATCH_PARENT) {
            childWidthMode = MeasureSpec.EXACTLY;
            childWidthSize -= (horizontalMargin);
        }
        // ****for  wrap_content condition 
        else if(lp.width == LayoutParams.WRAP_CONTENT){
            childWidthMode = MeasureSpec.AT_MOST;
            childWidthSize = sizeWidth-horizontalMargin-widthUsed;
        }

        else if(lp.width >= 0) {
            childWidthMode = MeasureSpec.EXACTLY;
            childWidthSize = lp.width;
        }

after:
screenshot_2016-06-28-14-56-56

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