如何在Android项目中包含Android GridLayout支持库?

时间:2013-08-06 17:07:19

标签: android compiler-errors grid-layout android-sdk-tools

我正在尝试将向后兼容的Gridlayout库添加到我的android项目中,但我无法使其正常工作。而且,我已经阅读了谷歌和stackoverflow上的所有其他文章,但它仍然无效。

以下是我一步一步做的事情:

  1. 将Gridlayout项目作为现有项目导入我的工作区。我使用了我在sdk中找到的Gridlayout项目,即这条路径:adt-bundle-mac-x86_64/sdk/extras/android/support/v7/gridlayout

  2. 在我的实际项目中,我转到Properties, Android并将android-support-v7-gridlayout作为库添加到我的项目中。

  3. 然后我去了我的项目中的xml布局文件并添加了一个GridLayout。

  4. 以下是代码:

    <android.support.v7.widget.GridLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    

    我的问题:当我切换到我的xml布局的图形布局时,我看到此错误消息:

    The following classes could not be found:
    - android.support.v7.widget.GridLayout (Change to android.widget.GridLayout, Fix Build Path, Edit XML, Create Class)
    

    我该怎么办?有小费吗?这真让我疯狂......

    以下是我项目的其他信息:

    • 在我的Android Dependencies文件夹中,我有android-support-v7-gridlayout.jar
    • 在我的gen文件夹中,我有一个名为android.support.v7.gridlayout
    • 的包
    • 我工作区中的项目android-support-v7-gridlayout 有任何错误

    编辑:这是我项目的截图:

    Screenshot of my project

0 个答案:

没有答案