0

I am developing an Android app which I use wrap_content/wrap_content to set the layout_width/layout_height for many ImageViews. However, the images look smaller on the Nexus5X (1920x1080 420dpi) than they appear on the Nexus5(1920x1080 480dpi). The two phones will use the same set of images in the drawable-xxhdpi bucket.

The question is: is there a possible way to maintain the same physical sizes of images for devices in the same density bucket but different dpi?

  • show some code, how do you currently getting dimens/sizes? [this question might be useful](http://stackoverflow.com/questions/2193457/is-there-a-way-to-determine-android-physical-screen-height-in-cm-or-inches) – snachmsm Nov 13 '16 at 21:57
  • I do not use any specific ways to get sizes. I just put some ImageViews in the layout and install apk to the two phones. Then I can see the images look physically smaller on the 5X. – jianhua chen Nov 14 '16 at 21:14
  • The ways mentioned in the [Support Multiple Screens](https://developer.android.com/guide/practices/screens_support.html) page seems to only explain how to achieve density independence across the density buckets. Should we just accept the fact that the physical size of dp and images might vary for devices in the same density bucket? – jianhua chen Nov 14 '16 at 21:22
  • have you tried methods from linked question/answer in my previous comment? `DisplayMetrics` class have xdpi and ydpi for precise calculations. if you want to differ mentioned devices only with XML - it's not possible – snachmsm Nov 15 '16 at 18:15

0 Answers0