Has anybody gotten the support library to render a grid layout correctly in Android 2? Instead of 2 rows and columns I get a single row on the screen and see this error in the logcat output: Android GridLayout Could not find method android.support.v7.widget.ViewGroup.onChildVisibilityChanged
The same exact layout is working on Android4 -> ICS when I change the layout tag from android.support.v7.widget.GridLayout to GridLayout
这会不会与设置有问题?我在我的Eclipse项目属性的Android标签里有电网路布_v7图书馆项目, v.13罐正在建设中。
失败的 XML 版式在下面贴上 。 我将布局行和列明确添加到图像按钮标签中, 以便围绕问题开展工作 。 如果有人在支持库中有一个运行在 Android 2 上的工作示例, 请分享 。
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="2" android:rowCount="2"
android:gravity="center_vertical"
android:layout="@drawable/bg_test_main" >
<ImageButton android:id="@+id/btnSentence"
android:layout_row="0"
android:layout_column="0"
android:src="@drawable/testa_btn"
android:contentDescription="@string/spin_fill_in"
android:background="@android:color/transparent"
/>
<ImageButton android:id="@+id/btnAudio"
android:layout_row="0"
android:layout_column="1"
android:src="@drawable/testb_btn"
android:contentDescription="@string/audio_quiz"
android:background="@android:color/transparent"
/>
<ImageButton android:id="@+id/btnPickWord"
android:layout_row="1"
android:layout_column="0"
android:src="@drawable/testc_btn"
android:background="@android:color/transparent"
android:contentDescription="@string/def_pick_word" />
<ImageButton android:id="@+id/btnPickDef"
android:layout_row="1"
android:layout_column="1"
android:src="@drawable/testd_btn"
android:background="@android:color/transparent"
android:contentDescription="@string/pick_def" />
</android.support.v7.widget.GridLayout>