Flexible android layout for multiple screen sizes/densities

后端 未结 2 1637
星月不相逢
星月不相逢 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:14

    The android documentation has a great guide on the subject:

    Supporting Multiple Screens

    They introduce generalized sizes and densities and show how different resources can be loaded dynamically for different screens.

    I'm new to android myself, so don't take my word for it, but, I think you can get away with one layout for all screen sizes, and I think RelativeLayout will work well (in most cases), especially with something as complex as a card game. I've mainly used LinearLayouts inside RelativeLayouts when I've wanted to align buttons/text horizontally.

提交回复
热议问题