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

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

Open
JackLeeMing opened this issue Jun 28, 2016 · 1 comment

Comments

@JackLeeMing
Copy link

JackLeeMing commented Jun 28, 2016

        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

@JackLeeMing JackLeeMing changed the title I think when the child‘s width is wrap_content we should add a condition,so the Messure mode is AT_MOST for child I think when the child‘s width is wrap_content we should add a condition,so the Measure mode is AT_MOST for child Jun 28, 2016
@JackLeeMing
Copy link
Author

before
sd

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