Screen Resolution of android

后端 未结 4 397
星月不相逢
星月不相逢 2021-01-07 11:06

I am developing an android application for resolution 320x240. i want to use this same application for higher resolution is it possible or i have to design UI for every res

相关标签:
4条回答
  • 2021-01-07 11:40

    Scale your application to be supported in different screen resolutions by following the guidelines at this link.

    http://developer.android.com/guide/practices/screens_support.html#screen-independence

    Mainly you have to use density index pixels(dp) as the unit to define size wherever you need rather than hardcoding with px

    0 讨论(0)
  • 2021-01-07 11:45

    Make your design 'fluid' by avoiding e.g. AbsoluteLayout (see the documentation for details). Graphics should be provided for each resolution in the drawable-Xdpi folders.

    0 讨论(0)
  • 2021-01-07 11:55

    Android was designed to fit different resolution automatically. I would advice to read article from google about it.

    0 讨论(0)
  • 2021-01-07 11:55

    You need not to use different layout for different resolution. What you need is just use three different resolution images of same name for all images and keep them in separate drawable folders(named drawable-hdpi,drawable-mdpi,drawable-ldpi) and also use screen width according to screen resolution whenever needed.For example :

    int width=getWindowManager().getDefaultDisplay().getWidth() ;
    

    gives you complete screen width.

    For more details see Supporting Multiple Screens

    Hope this will help you.

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