2009/2/10 Bobbie <[email protected]> > > I have a couple different questions: > > 1) Does Google think there will only be one screen size on Android > phones? The reason I ask is because I haven't been able to find > anything on "variable" layouts in Android? I would like to create a > layout with 2 webviews, one 80% of screen height and the other 20%. > Is this even possible, or do I need to assign the height of each as a > static "px" value? > > Android caters for different screen sizes already. The Openmoko Freerunner runs Android quite happily on a larger resolution than the G1. If you edit the skins for your emulator (they are just text files) it is quite easy to simulate larger (or smaller) screen sizes for development.
Pretty much all layouts are 'variable', apart from the fixed ones: a ListView will have more lines on a larger screen etc. What you are after is the android:layout_weight="x" attribute for your view elements. In your case you want, probably inside a LinearLayout, two elements, one with a weight of 4, the other 1. The weights are relative, so the first will get 80% of screen height, the other 20. HTH Ludwig > > 2) How do I preserve the data in my views when someone switches > between landscape and portrait? I doubt it's hard, but I've not been > able to find it. Can someone post an example? > > Thanks everyone! > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

