如何使用这个库中的Andr​​oid?使用这个、库中、oid、Andr

2023-09-12 21:50:55 作者:惆怅旅客

我想做出一些动作条的使用这个库我的应用程序: https://github.com/johannilsson / Android的动作条的,但我不知道如何导入它在我的Andr​​oid项目。没有jar文件。我该怎么办?

I want to make some ActionBar for my application using this library: https://github.com/johannilsson/android-actionbar but I don't know how to import it in my android project. There is no jar file. How can I do?

弗洛

推荐答案

首先,确保你使用Android SDK的最新版本,事情已经在过去几个月内显着改善。

First, make sure you're using the latest version of the Android SDK, things have improved dramatically within the last few months.

安装Android的动作条源$ C ​​$ C,无论是下载并解压缩,或者使用Git克隆库您的系统上(preferably)。

Install the android-actionbar source code, either downloading it and unpacking it, or (preferably) using git to clone the repository on your system.

(我强烈建议您使用模拟本地-API的分支,因为它是最最新的。)

(I strongly recommend using the mimic-native-api branch as it is the most up to date.)

导入Android的动作条项目到Eclipse中。需要注意的是该库的项目文件位于Android的动作条/动作条。有一个在Android的动作条一个小样本项目/ actionbarexample为好。

Import the android-actionbar project into Eclipse. Note that the library's .project file is located in android-actionbar/actionbar. There is a small sample project in android-actionbar/actionbarexample as well.

该项目的库设置应该已经设置,但可以通过右键单击在Eclipse中Android的动作条项目证实了这一点,选择属性,并确认是图书馆是在Android设置类别启用。

The project's library setting should already be set, but you can confirm this by right-clicking on the android-actionbar project in Eclipse, choosing Properties, and confirming that "Is Library" is enabled in the Android settings category.

在Eclipse中,在您​​要使用的操作栏库中的项目上单击右键,然后选择属性。选择Android的类别中左侧的列表中。在右侧的库的设置,点击添加...按钮,选择Android的动作条库项目。

In Eclipse, right-click on the project that you want to use the action bar library in, and choose Properties. Select the "Android" category in the list on the left. In the "Library" settings on the right, click the "Add..." button and select the android-actionbar library project.

提示:我发现Eclipse可以得到一点松鼠,当你编辑库code,如果你碰上不想走开错误,使用项目>清除...,除去R. java文件,等等......然后刷新包浏览器和重建。

Tip: I've found Eclipse can get a bit squirrely when you edit library code, if you run into errors that don't want to go away, use Project > Clean... to remove the R.java files, etc. ...then refresh your package explorer and rebuild.