user3121403
user3121403

Reputation: 133

How to design app for multiple screens

I've designed my UI in pixels(px) in the dimensions 700x400. Is it possible to stretch the ui along with the different phones?

Upvotes: 0

Views: 109

Answers (5)

Sucho
Sucho

Reputation: 321

Make different xml files for different layouts. You have to put the xml files in the folders accordingly(You have to keep the layout names and the id's same in each of them) Make folders like layout-land, Layout-Normal-Land, layout-xlarge etc. You also need different drawable for different screen density. You can create folders accordingly like- drawable-small-mdpi, drawable-large-hdpi and others.

Upvotes: 1

Ashwini
Ashwini

Reputation: 136

Always use dp while designing android layout. Have a look on following url for better understanding of multiple screen support in android. http://www.survivingwithandroid.com/2012/07/how-to-support-multiple-screen-in.html

Upvotes: 1

Vivek Warde
Vivek Warde

Reputation: 1504

You have to do it manually !

  • Create different folders of name layout-small, layout-large, layout-xlarge in res folder
  • Copy-paste all ur .xml's from ur layout to thes folder
  • Open all the xml's & set the margins with using different screen sizes one by one
  • Then u can run & see the app in different size emulators

Upvotes: 1

dimak
dimak

Reputation: 36

You should do this in dp and for different screen size should use different values mdpi, hdpi, xhdpi etc. Not only drawable but possibly different layouts and values for width, height, paddings, margins etc

Upvotes: 1

Giant
Giant

Reputation: 1649

have different drawable for different screen size check this for more info

Upvotes: 0

Related Questions