Problem in screen resolution
I have created an app.During creation i have used Nexus s device for testing of my app.But i want my app to support multiple screen.So for that have created separate layout for small device, medium device and so on as suggested in android support multiple screen documentation.Now my problem arise in maintaining layout for Nexus s device having resolution of 480 x 800 pixels and Samsung galaxy ace having resolution of 320 x 480 pixels (ie HVGA devices) because both these device uses same layout folder not like other small/medium device 开发者_开发问答which take its layout from layout-small/layout-medium directory.So its very difficult for me to manage the layout for nexus s device and Samsung galaxy ace device/HVGA devices,because if i manage layout for nexus s devices than its not fit in HVGA devices, similarly if i maintain layout for HVGA device than its not match for nexus s devices.So how can i create separate layout for these two range of devices,because in the documentation it is given that for devices having resolution of 320x480 mdpi, 480x800 hdpi, etc would used the same layout.So please help me to solve this out.
If you use dp/dip (density independent pixel) units in your layout instead of px, everything should be fine.
Did you use fix size for the width and height in your xml? I think if you want to support different screen resolution, you have to use the standard android code for layout width and height. And be sure to use draw9patch in your images.
精彩评论