Hello,
I'm trying really hard to understand how the GridView calculates its height 
and what is the best way to trouble shoot problems in this domain.
The problem's details are as follows:
the main view contains listView defined like this:
<ListView  android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

Each row is a button and a gridview put together in the LinearLayout 
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:minHeight="40sp" android:descendantFocusability="afterDescendants">

<Button 
android:layout_width="wrap_content" android:layout_height="wrap_content" 
android:minWidth="30sp"/>

<GridView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:numColumns="auto_fit"
android:columnWidth="40sp" android:stretchMode="columnWidth"
/>

GridView is filled with buttons:
<Button  android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:layout_margin="0sp"  />
Unfortunately when the view is displayed all gridviews are much higher than 
their children would require that. In HierarchyViewer I see that the buttons 
have mMeasuredHeight 30 (mminHeight: 0, no padding), but its parent - 
GridView has mMesuredHeight 64. I tried many other, less intuitive setting 
for layout without any luck. I also experimented with setting the height 
from the code, but then it becomes fragile and behaves on other phones.
Any advice on how to investigate this problem, fix it or develop more stable 
work around would be very welcome!

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to