I've come across a bit of a weird issue with activities using the Holo Dialog theme (@android:style/Theme.Holo.Dialog
) in Ice Cream Sandwich.
It seems like they ignore their layouts and fill the entire screen instead of the layout width and height from their XML layouts. The same layouts are working as expecting in Honeycomb, but not on Ice Cream Sandwich.
Example:
The correct way (Honeycomb)
The incorrect way (Ice Cream Sandwich)
Both devices are running the exact same version of the application, and are using the exact same layout. Here's the layout in question:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="940dp"
android:layout_height="600dp"
android:layout_margin="10dp" >
<GridView
android:id="@+id/gridView1"
android:layout_width="940dp"
android:layout_height="600dp"
android:horizontalSpacing="10dp"
android:numColumns="3"
android:smoothScrollbar="true"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" >
</GridView>
</LinearLayout>
Any ideas to how this can be solved? A similar issue occurs on my ICS-based Galaxy Nexus, which completely ignore the match_parent
tag for height and width. Is the dialog theme broken in ICS?
Update:
I've done some more testing, and it seems like 894dp of width or less will produce the "correct" look, but if I set the width to 895dp or more, it'll be the incorrect look. The emulator's acting the same way. This is extremely weird...