What I am trying to do is make my game center in any screen with the
best fit to screen and maintain ratio. Is there a good way to do this?
This is my current xml. I have an outer linearlayout to center the
middle one, all good in most resolutions but doesn't work well in
WQVGA400. If I could make the layout_width a percentage of
layout_height I think I could solve my issue as I can make
layout_width = fill_parent, and then make make layout_height use a %
of layout_width which should maintain aspect ratio. Actually I don't
even understand why the below concept doesnt work on a WQVGA400
screen??
<LinearLayout android:id="@+id/outerlayout"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://
schemas.android.com/apk/res/android"
android:gravity="center">
<LinearLayout android:layout_width="320dip"
android:layout_height="480dip" xmlns:android="http://
schemas.android.com/apk/res/android"
android:focusable="true" android:focusableInTouchMode="true"
android:background="@drawable/menu_background" android:id="@+id/
main_menu">
<LinearLayout android:orientation="vertical"
android:layout_centerInParent="false"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_alignParentTop="false"
android:layout_alignParentBottom="false"
android:layout_alignParentLeft="false"
android:layout_centerHorizontal="false"
android:layout_centerVertical="false"
android:layout_alignParentRight="false"
android:layout_marginLeft="170dip"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/scroll_7buttons"
android:layout_marginTop="150dip"
android:id="@+id/mainMenuLayout">
</LinearLayout>
</LinearLayout>
</LinearLayout>
--
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