https://kotlinlang.org logo
#compose
Title
# compose
r

Rafs

12/04/2020, 9:48 AM
How do you add inner padding in compose?
padding
modifier only seems to add margin
1
s

sindrenm

12/04/2020, 9:52 AM
Do you have a concrete example? If your case is that you have a background or border or something for your composable and then want some padding inside of that, then remember that modifier order matters.
Copy code
Modifier
  .padding(8.dp)
  .background(Color.White)
is different from
Copy code
Modifier
  .background(Color.White)
  .padding(8.dp)
The latter might be what you're looking for? simple smile
👍 3
r

Rafs

12/04/2020, 9:58 AM
Thank you, this was just what I was looking for
s

sindrenm

12/04/2020, 9:59 AM
Perfect! Glad to help. simple smile
3 Views