Inner padding of a Text with Jetpack Compose

Viewed 1532

In the UI design of a screen, I have a very big text (180 sp). To follow the design though I need to have just a 16 dp padding around the text, including the inner vertical padding of the text. The problem is that even if I put a padding of 0 dp the inner padding is already bigger than 16 dp

Is there a way to set to 0 the inner vertical padding of a Text with Jetpack Compose?

1 Answers

Actually that is innate, it follows material guidelines. If you wish to disable it, an alternative would be to look at the source of Text. You could just copy the source and make modifications to meet your requirements. It is doable, and is a recommended practice to customize behavior for your needs.

Related