Android Emulator loading wrong layout screen sizes
I have written an app that required me to create the following additional folders in order to support multiple screen sizes: layout-land, layout-small-land, and layout-small-port.
When I load an AVD for a QVGA screen, the emulator is loading the screen sizes from the HVGA settings, and I need to know how to force the emulator to load the correct files. I know it's loading the incorrect files because initially when I loaded the QVGA AVD, all of the text was too large, so I spent a few hours adding new versions of all my activiti files to the layout-small-port folder, then I retested and saw normal-sized text for the QVGA screen, and then I turned off my computer. The next time I turned on the computer and loaded the app in the QVGA AVD, suddenly all of the text on screen was super-small and barely readable. So, I pro开发者_StackOverflow社区ceeded to delete all of the new files I had just added to the layout-small-port folder and re-ran the QVGA AVD, and all of the text appeared correctly.
This morning I have loaded the QVGA AVD again, and once again the text is too large. Before my latest round of updates, the data in the QVGA screen had always appeared correctly, but now everything from the menu sizes to the text on screen is not being scaled to QVGA-sizes.
Do I need to re-add all of those screens for layout-small-port, or is there something going on in the emulator that I can fix?
I have set the text sizes in the affected activities using "dip" (i.e. 10dip). In my Android Manifest file, I set minSdkVersion=3 and targetSdkVersion=4 so that people with Android 1.5 can still download my app. My app is built against Android 1.6.
You might want to check this out:
http://blog.blundell-apps.com/emulator-settings-for-each-android-density/
It explains how to set the emulator for different density buckets (ldpi, mdpi .. etc) these are much easier to user than layout-large (which I believe is being deprecated anyway)
精彩评论