Android:导入DrawerLayout无法解决

Android: Import DrawerLayout cannot be resolved(Android:导入DrawerLayout无法解决)
本文介绍了Android:导入DrawerLayout无法解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试从 Android 导入使用新的导航抽屉"所需的类http://developer.android.com/design/patterns/navigation-drawer.html#ImpactOnNav

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

抽屉布局:http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html

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

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

无法解析导入android.support.v4.widget.DrawerLayout无法解析导入android.support.v4.app.ActionBarDrawerToggle

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.

推荐答案

如何更新库中的 JAR?

How do I update the JARs in libs?

我通常通过复制文件来做到这一点.您将在 $ANDROID_SDK/extras/android/support 中找到 JAR,其中 $ANDROID_SDK 是安装 Android SDK 的位置.

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.

如果您使用 Eclipse,如果您在文件系统级别复制此文件,并且 Eclipse 已打开,请按 <F5> 并在包管理器中突出显示项目,以便 Eclipse 获取更改.更简单的方法是将它拖出 SDK 并将 JAR 放入 Eclipse 中的 libs/ 中,这将更新文件系统并让 Eclipse 知道更改.

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.

添加 JAR 的 Eclipse 选项(右键单击项目,然后从上下文菜单中选择 Android Tools > Add Support Library...)也可能会执行此操作.由于我的开发环境的一些特殊性,这种特殊方法对我不起作用.

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.

这篇关于Android:导入DrawerLayout无法解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)