安卓:进口DrawerLayout不能得到解决 [英] Android: Import DrawerLayout cannot be resolved

查看:173
本文介绍了安卓:进口DrawerLayout不能得到解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图导入从Android的使用新的抽屉式导航栏所需的类 <一href="http://developer.android.com/design/patterns/navigation-drawer.html#ImpactOnNav">http://developer.android.com/design/patterns/navigation-drawer.html#ImpactOnNav

DrawerLayout: <一href="http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html">http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html

ActionBarDrawerToggle: <一href="http://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html">http://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html

进口android.support.v4.widget.DrawerLayout不能得到解决 进口android.support.v4.app.ActionBarDrawerToggle不能得到解决。

我已经更新了库到最新版本,但还是这些类不被识别。

解决方案
  

如何更新的JAR文件的库?

我通常通过复制文件做到这一点。你会发现里面 $ ANDROID_SDK /演员/安卓/支持,其中 $ ANDROID_SDK 是无论你的Andr​​oid SDK是JAR文件安装。

如果你使用Eclipse,如果复制这种在文件系统级别,而Eclipse是开放的,preSS &LT; F5&GT; 与项目的软件包管理器高亮这样的Eclipse拿起变化。更简单的是将其拖出SDK的拖放JAR成库/ 权在Eclipse中,这都将更新文件系统,让Eclipse的了解的变化。

这有可能是Eclipse的选项添加JAR文件(右键单击以上项目,然后选择Android的工具>添加支持库...从上下文菜单中)也将这样做。我由于一些特殊性与我的开发环境,特定的方法是行不通的。

I'm trying to import the classes required to use the new "Navigation Drawer" from Android http://developer.android.com/design/patterns/navigation-drawer.html#ImpactOnNav

DrawerLayout: http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html

ActionBarDrawerToggle: http://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html

The import android.support.v4.widget.DrawerLayout cannot be resolved The import android.support.v4.app.ActionBarDrawerToggle cannot be resolved

I have updated the libraries to the latest version but still these classes are not recognized.

解决方案

How do I update the JARs in libs?

I usually do it by copying the file. You will find the JARs inside $ANDROID_SDK/extras/android/support, where $ANDROID_SDK is wherever your Android SDK is installed.

If you use Eclipse, if you copy this at the filesystem level, and Eclipse is open, press <F5> with the project highlighted in Package Manager so Eclipse picks up the changes. Easier is to drag it out of the SDK and drop the JAR into libs/ right in Eclipse, which will both update the filesystem and let Eclipse know about the change.

It's possible that the Eclipse option to add the JARs (right-click over the project, then choose Android Tools > Add Support Library... from the context menu) will also do this. That particular approach doesn't work for me due to some peculiarities with my development environment.

这篇关于安卓:进口DrawerLayout不能得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆