Flexible android layout for multiple screen sizes/densities

后端 未结 2 1640
星月不相逢
星月不相逢 2021-01-13 19:33

I am working on creating a card game for android. I am trying to come up with a layout that will allow the game to be played on all screen sizes and densities.

I hav

2条回答
  •  无人共我
    2021-01-13 20:23

    firstly, I'm sorry my English is not good enough. You should divide your resources into some folders (based on screen size), for example, make different layouts from different resources. You can do like below:

    1.drawable

    -drawable-hdpi
    
    -drawable-mdpi
    
    -drawable-ldpi
    

    2.layout

    --layout-hdpi
    
    --layout-mdpi
    
    --layout-ldpi
    

    customize your resource for each screen size, it makes your application is applicable for many device.

提交回复
热议问题