我有一個Android項目,它在大部分菜單和屏幕中都使用GridLayout。然而問題是GridLayout是從API 14開始支持的。android.support.v7.widget.GridLayout無法啓動它
因爲我想讓應用程序可以使用老版本的android,所以我嘗試使用Android自己的支持庫GridLayout,它增加了對API 7的支持。 這正是我所期待的,但是我不能爲了我的生活得到它的工作。我已經嘗試了所有這些解釋和想法:
和MOR è...
不管我做什麼,我該怎麼辦呢還是我用的IDE(Eclipse中是否ADT或Android工作室),它總是給我沿着線的佈局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
編輯:供參考,這是我用來創建支持網格佈局(直接從Android示例程序採取)什麼:
<android.support.v7.widget.GridLayout
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"
>
<TextView
android:text="@string/string_test"
/>
<EditText
app:layout_gravity="fill_horizontal"
app:layout_column="0"
app:layout_columnSpan="4"
/>
<Button
android:text="@string/button_test"
app:layout_column="2"
/>
</android.support.v7.widget.GridLayout>
我該怎麼辦可能是做錯了,沒有任何上述解決方案工作?有什麼我錯過了,也許有我的原始代碼有問題?
任何幫助表示讚賞
把你的xml代碼 – nsvir
@nsvir - 添加我的XML代碼,雖然沒有什麼特別的,但我使用了Android – user475680