ほとんどのメニューと画面で GridLayout を使用する Android プロジェクトがあります。ただし、問題は GridLayout が API 14 以降でサポートされていることです。
アプリケーションを古いバージョンの Android でも利用できるようにしたいので、API 7 までのサポートを追加する Android 独自のサポート ライブラリGridLayoutを使用しようとしました。これはまさに私が探していたものでしたが、私の人生ではできません。それを機能させます。私はこれらすべての説明とアイデアを試しました:
もっと...
何を、どのように行うか、または使用する 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
編集:参考までに、これはサポートグリッドレイアウトを作成するために使用しているものです(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>
上記の解決策のいずれも機能しないということは、何が間違っている可能性がありますか? 元のコードに問題がある可能性がありますか?
どんな助けでも大歓迎です