Guys, I don’t understand how to make a Image with ...
# compose
m
Guys, I don’t understand how to make a Image with inner padding
Copy code
Icon(
            painter = painterResource(id = R.drawable.ic_baseline_delete_24),
            modifier = Modifier.align(Alignment.TopEnd)
                .size(40.dp)
                .padding(8.dp)
)
Still there is not inner padding applied somehow…
g
set padding before size
m
I tried it before, but then it has effect of a margin…
g
it depends on order of modifiers. But I think in this case you just setting size, so what kind result do you expect? Can you just add 16dp to Size?
m
I want to have a padding so I have more clickable area in xml, its pretty easy with
Copy code
<ImageView
   background="?selectableItemBackgroundBorderless"
   scr="some vector drawable"
   padding = 8dp
   width = "wrap_content"
   height = "wrap_content"
>
g
I want to have a padding so I have more clickable area
Isn’t you should use IconButton for this with own size and click listener?
m
hmmm you are right, seems like I have to use IconButton for this case now
Thank you
z
are you trying to only change the touch area without affecting the layout? I think support for that was just released in the latest alpha
🤔 2
m
how to do that?