抽屉布局无法解析为某种类型

时间:2014-03-04 09:23:28

标签: java android eclipse android-fragments import

我是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

请帮帮我。

5 个答案:

答案 0 :(得分:3)

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

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

之后清理你的项目。

答案 1 :(得分:1)

尝试使用相应的lib为您的Drawer布局添加前缀,因为导入lib时可能存在冲突(当我尝试实现FragmentManager时我有这个pb)

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

答案 2 :(得分:0)

尝试更改项目support-v4.jarlibs中的clean。它应该工作。

答案 3 :(得分:0)

按照以下link描述

导入项目中的支持​​库

答案 4 :(得分:0)

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

了解更多信息Click Here ...