How to resize image view according to screen resolution and size

后端 未结 2 1789
一向
一向 2021-01-27 14:33

I want to resize image view according to screen resolution and size. How to do it? I searched android development tutorials.. but it is useless.. pls help.. It\'s for my mini pr

相关标签:
2条回答
  • 2021-01-27 15:04

    By default, Android maintain multiple folders for the images with different resolutions. Reason behind that is the resolution of the Android Device on which the application is gonna run.

    • hdpi - maintain images for the Android Broad Screen set or Android Phones with the Higher resolution.

    • ldpi - for Lower images quality.

    • mdpi - for medium images support.

    • xhdi - images folder for devices with maximum resolution.

    Android OS will select the image itself by checking the compatible device and its resolution. Hope this helps your cause.

    0 讨论(0)
  • 2021-01-27 15:05

    You can try to scale the image to X,Y coordinates by setting:

    android:scaleType="fitXY"
    

    property.

    0 讨论(0)
提交回复
热议问题