I made a simple app with 开发者_StackOverflowrelative layout and dips. the problem is that on larger screens it just takes up a tiny part of the screen. is there a way to make it just one size and somhow scale to larger screens keping the layout intact?
You want to create a new folder layout-large
and one layout-normal
.
Copy your xml files that have fixed sizes to both folders, and adapt the size of the fixed-size View
s to the larger screens (in layout-large). It will be approximately 50% larger. You can fine tune the sizes in the emulator. I found it easy to have two emulator instances, one with a normal screen and one with a large one so I can tweak the sizes and see the results in both layouts.
Also, consider that many of the larger screens retain the same resolution as the bigger phones (thus, having a much reduced dpi), so you may want to scale down images and copy them to a drawable-mdpi
folder, keeping the originals in a drawable-hdpi
folder.
Read the Android SDK section on Supporting Multiple Screens
This goes over what the best practices are for how to do this.
精彩评论