UI for different screen densities

前端 未结 2 532
夕颜
夕颜 2021-01-29 04:00

I don\'t understand the benefit of resources configuration qualifiers designed to support multiple screen densities, for example :

  • for an mdpi you put an icon o

2条回答
  •  离开以前
    2021-01-29 04:13

    The main reason for that is basically letting you define multiple layouts for each screen size with the possibility to change the "SAME" graphics from a screen size to another, let me give you an example: Imagine that you have an activity which its layout is defined for mdpi and hdpi screens. In the hdpi screen you show a full banner with text inside (let's assume the resource is for this banner is R.drawable.topbanner), however this banner is not comfortable to show in smaller screen like mdpi after resizing, so you decided to make a timmed version of this banner for the mdpi screens with the same resource id (R.drawable.topbanner) in which you removed some text for example. Now the system will decide, depending on the screen size, which one to use.

提交回复
热议问题