Screen Resolution of android

后端 未结 4 396
星月不相逢
星月不相逢 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: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.

提交回复
热议问题