-1

Base on my research, I need to create a layout for large screen. Is there other way not to create new layout? Does the android does not automatically resize the image and layout base on screen size?

Thanks.

an631a
  • 31
  • 3

2 Answers2

1

Yes you can create different dimens.xml files for different devices and set dimensions in dp for different devices. check this link click here

Community
  • 1
  • 1
Rahul Sharma
  • 5,949
  • 5
  • 36
  • 46
  • Do you have a sample project that supports multiple screen? Can you send me the link so that I can study it? Thanks alot. – an631a Mar 17 '15 at 05:56
0

Or you can use attributes which will make the layout take the entire space (resize as you ask in you question). The attributes can be different depending on what you want to do. For example, match parent, if the parent is taking up the entire view space, or use scaling attributes on ImageView, etc.

sushantsha
  • 81
  • 1
  • 7
  • should I still create different images? and put it in hdpi, mdpi? i have an image 1619 pixels x 801pixels, resolution is 72 pixels/inch. where should i put it? in hdpi? – an631a Mar 16 '15 at 10:58
  • how to convert the image in different sizes? thank you – an631a Mar 16 '15 at 11:02
  • That depends on what extent of clarity you want. This is what I suggest to start with: Put your image in mdpi and see how the image looks when your imageview's size changes. If for high resolution devices or for bigger size of the image view (in both cases you might fall short of pixels in your image theoretically) your image looks pixelated, you can think of providing an alternate image. If you dont provide that, android will try to do the best scaling it can and the image might or might not look good. You should try it and see. – sushantsha Mar 18 '15 at 12:49