我有一个Android项目,它在大多数菜单和屏幕中使用GridLayout。然而,问题是GridLayout是从API 14及以后支持的。
由于我想将应用程序提供给旧版本的Android,所以我尝试使用Android自己的支持库GridLayout,它增加了API 7的支持。
这正是我正在寻找的,但是我不能为了我的生活让它工作。我已经尝试了所有这些解释和想法:
和更多…
无论我做什么,我如何做,或者我使用什么IDE(不管是Eclipse ADT还是Android Studio),它总是给我一个错误的布局XML中的以下行:
The following classes could be instantiated: - android.support.v7.widget.GridLayout
With either one of these exceptions showing in the error log:
1. android.content.res.Resources$NotFoundException: Could not resolve value 0x7F080000
2. java.lang.classnotfoundexception: android.support.v7.gridlayout.R$dimen
编辑:为了参考,这是我用来创建支持gridlayout(直接从android示例程序中获取):
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/blue"
android:padding="10dip"
app:columnCount="4"
>
android:text="@string/string_test"
/>
app:layout_gravity="fill_horizontal"
app:layout_column="0"
app:layout_columnSpan="4"
/>
android:text="@string/button_test"
app:layout_column="2"
/>
我可能做错了什么,上述解决方案都不行吗?有没有我错过的东西,也许我的原始代码有问题?
任何帮助是赞赏