0

I have an UHD png image and display it on the screen using a coil AsyncImage. AsyncImage is in the Box composable. Also there is a Button in the Box and I place it over the AsyncImage with graphicsLayer modifier. The offset is 200px along x axis and 100px along y axis for example. It works because Box hasn't got its own size and it just wrap content size so Box "resolution" is also UHD.

The problem is when I open my app on the other device with other density of pixels the Button position slightly different (I guess that more density difference - more difference) than on my first device but I need completely the same positioning. How can I do that?

Thank you in advance!

  • So, as my research didn't finish with success, I will do the following actions: 1. Translate pixel offset to dp with local density 2. Set the width of the Async using width modifier to my file width in PIXELS 3. do the same with height 4. On another device the size of AsyncImage will be the same cause it hard coded to its modifier and offset will be accurate too as it is in density pixels The problem 100% in Coil or in its data. If someone knows how to avoid density pixels please write about it:) – Danil Chegaev Jul 18 '23 at 17:15
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Jul 19 '23 at 06:03

0 Answers0