ciscorucinski
11/19/2020, 11:22 AMpadding(...)
. This works with padding towards the end.
Image(
modifier = Modifier
.width(70.dp).height(70.dp)
.border(
border = BorderStroke(2.dp, color = Color.White),
shape = CircleShape)
.clip(shape = CircleShape)
.padding(8.dp), // * * HERE near bottom - works * * //
asset = Icons.Filled.Person,
colorFilter = ColorFilter.tint(color = Color.White)
)
However, move it towards the top, and no padding is added at all.
Image(
modifier = Modifier
.width(70.dp).height(70.dp)
.padding(8.dp) // * * HERE near top - fails * * //
.border(
border = BorderStroke(2.dp, color = Color.White),
shape = CircleShape)
.clip(shape = CircleShape),
asset = Icons.Filled.Person,
colorFilter = ColorFilter.tint(color = Color.White)
)
Joost Klitsie
11/19/2020, 11:50 AM|<padding><background><content><background><padding>|
however, if you put background first, you see:
|<background><padding><content><padding><background>|
So here the padding essentially replaces margin as well, depending on in what order you put it. You can also add padding first, then a background, and then a padding again. In that case you will see an object with margin around it, then the object itself also has padding
|<padding><background><padding><content><padding><background><padding>|
ciscorucinski
11/19/2020, 12:01 PMannsofi
11/19/2020, 12:33 PM