有人成功使支持库在Android 2中正确呈现网格布局吗?屏幕上只显示一行,而不是两行和两列,并且在logcat输出中看到以下错误:Android GridLayout Could not find method android.support.v7.widget.ViewGroup.onChildVisibilityChanged。
当我将布局标签从android.support.v7.widget.GridLayout更改为GridLayout时,完全相同的布局在Android4->ICS上工作正常。
这可能与设置有关吗? 我在Eclipse项目属性的Android选项卡中具有gridlayout_v7库项目,并且v.13 jar位于构建路径上。
下面贴出了XML布局,它失败了。 我在图像按钮标记中显式添加了布局行和列,以尝试解决问题。 如果有人拥有在支持库下运行的Android 2上的可用示例,请分享。
当我将布局标签从android.support.v7.widget.GridLayout更改为GridLayout时,完全相同的布局在Android4->ICS上工作正常。
这可能与设置有关吗? 我在Eclipse项目属性的Android选项卡中具有gridlayout_v7库项目,并且v.13 jar位于构建路径上。
下面贴出了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>
GridLayout
的属性中,我得到的是app:rowCount
而不是android:rowCount
? - mr5