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

How to solve : RatingBar Height Wrap_content Problem #2

Open
mingZZ-3 opened this issue Nov 2, 2023 · 0 comments
Open

How to solve : RatingBar Height Wrap_content Problem #2

mingZZ-3 opened this issue Nov 2, 2023 · 0 comments

Comments

@mingZZ-3
Copy link

mingZZ-3 commented Nov 2, 2023

Like i said in the title.
if i use your custom RatingBar(w height="wrap_content"), height is more larger than the svg size.
스크린샷 2023-11-02 오후 3 02 54

to solve this problem(?) change the 'onMeasure' code to below.
`

override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec)
    if (mSampleTile != null) {
        val width = mSampleTile!!.width * numStars
        setMeasuredDimension(
                resolveSizeAndState(width, widthMeasureSpec, 0),
                resolveSizeAndState(mSampleTile!!.height, heightMeasureSpec, 0)
        )
    }
}

`

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