Best practices to use when targeting multiple screen resolutions on Android

前端 未结 4 2183
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-11 03:30

When designing an UI, we need to target many android mutations and various screen resolutions.

  • How to differentiate layout for 480 * 800 and 480 * 854 screen resolu
4条回答
  •  有刺的猬
    2021-02-11 03:58

    If you build your views using "dp" it would, basically, be the same size for eack screen size.
    In most cases you will prefer that your view will resize itself proportional to the screen size.
    Of course, in most cases you will need to build separate layouts for tablets.
    But, besides I can recommend you to do the next steps:

    1. Add this library to your project.

    2. Now in your layout you can write views like that:

    
    

    In this example your TextView will scale on each screen size.

提交回复
热议问题