【问题标题】:Drawer layout cannot be resolved to a type抽屉布局无法解析为类型
【发布时间】:2014-04-05 17:39:46
【问题描述】:

我是android新手,我尝试了很多方法来解决这个错误,但没有成功,请帮我解决这个问题

我的进口

import tabswipe.TabsPagerAdapter;
import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.FragmentTransaction;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.view.GravityCompat;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;

即使在导入这些之后。我收到以下错误 -

DrawerLayout cannot be resolved to a type    
ActionBarDrawerToggle cannot be resolved to a type

请帮助我。

【问题讨论】:

    标签: java android eclipse android-fragments import


    【解决方案1】:

    尝试将最新的支持库添加到您的项目中。

        Right click your project > go to android tools > add support library 
    

    之后清理您的项目。

    【讨论】:

    • 您使用的是哪个 SDK 版本?尝试使用 SDK 管理器更新到最新的支持库,即打开 SDK 管理器并查看是否有可用于支持库的更新。
    【解决方案2】:

    尝试在你的抽屉布局前加上相应的库,因为在你导入你的库时可能会发生冲突(我在尝试实现 FragmentManager 时有这个 pb)

    android.support.v4.widget.DrawerLayout myDrawer = ...

    【讨论】:

      【解决方案3】:

      尝试更改您的libsclean 项目中的support-v4.jar。它应该可以工作。

      【讨论】:

        【解决方案4】:

        在你的项目中导入支持库如下link描述

        【讨论】:

          【解决方案5】:

          将支持库导入您的项目..

          更多信息Click Here...

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2014-08-17
            • 2017-01-07
            • 2015-10-22
            • 1970-01-01
            相关资源
            最近更新 更多