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

QUERY - How to align it in centre #4

Open
md0092651 opened this issue Sep 10, 2024 · 1 comment
Open

QUERY - How to align it in centre #4

md0092651 opened this issue Sep 10, 2024 · 1 comment

Comments

@md0092651
Copy link

md0092651 commented Sep 10, 2024

First of all thanks for the awesome library.

I am creating a sample app with annotated string like this

 val text = buildAnnotatedString {
        withStyle(
            style = SpanStyle(
                fontSize = 90.sp
            )
        ){
            append(subjectText)
        }

        withStyle(SpanStyle(background = MaterialTheme.colorScheme.primaryContainer)) {
            append(tag)
        }
    }
    

the issue is the tag is not centre aligned.

is there any additional config to do so ? I played around the params of RoundedCornerSpanPainter but nothing works

2nd issue which I am facing it I have to give the topMargin = 45 SP manually else the background is full height

@saket
Copy link
Owner

saket commented Sep 10, 2024

Are the spans centered if you display the text without extended-spans?

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

2 participants