首先,我是新与Android。 我做一个应用程序,和我实现了一个名为 HoloEverywhere 库。 这在的themes.xml库中的ActionBar福尔摩斯库的使用。我已经导入到我的工作区的ActionBar福尔摩斯,我已经把它添加到HoloEverywhere。 接下来,我已经加入HoloEverywhere到我的项目,但是当我尝试使用它,我有一个错误(我试图用一个按钮):
First of all, I am new with Android. I am doing an app, and I am implementing a library called HoloEverywhere. This library use in the themes.xml the library ActionBar Sherlock. I have imported to my workspace ActionBar Sherlock and I have added it to HoloEverywhere. Next, I have added HoloEverywhere to my project, but when I try to use it, I have an error (I tried to use a button):
The following classes could not be instantiated:
- com.WazaBe.HoloEverywhere.ButtonHolo (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse.
我把我的布局类的路径,像这样的:
I put the path of the class in my layout, like this:
<com.WazaBe.HoloEverywhere.ButtonHolo
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/text" />
我怎么能解决这个问题,使用该库在我的项目?谢谢 :) PS。对不起,我的英语水平,我知道这是不是很好。
How I can solve this problem and use this library in my project?. Thanks :) PS. Sorry for my english, I know it is not very good.
按照以下(从博客采取的这里)添加 ActionBarSherlock
Follow the steps below(taken from blog here) to add ActionBarSherlock
文件&GT;新建 - &GT; Android项目
选择创建从现有的源
,然后项目浏览
到库
文件夹中提取 AndroidBarSherlock
文件夹
在构建目标应是最新(14或15),但是你的minSdkVersion可以少(7或8)
preSS 完成
单击新创建的项目右键,然后转到属性
。
在该安卓
标题,你会看到一个部分库
有一个复选框 IsLibrary
。确保的Checked。
右键单击 - 对项目>性的判定中,要添加 AndroidBarSherlock
在安卓
标题和库
部分选择添加
。
您应该看到 ActionBarSherlock
库,添加到您的项目
最后,如果你使用的的兼容性支持的,你需要删除的罐的,因为它包含在ActionBarSherlock。
Download the .zip/.tgz and extract it
Go to eclipse and choose File->New-> Android Project
Select Create project from existing source
and then browse
to the library
folder inside extracted AndroidBarSherlock
folder
Build Target should be the latest(14 or15), but your minSdkVersion can be less (7 or 8)
Press Finish
Right click on the newly created project and go to Properties
.
Under the Android
heading, you should see a section for Library
with a checkbox IsLibrary
. Make sure that's checked.
Right click -> Properies on the project in which you wish to add AndroidBarSherlock
under the Android
heading and the Library
section choose Add
.
You should see the ActionBarSherlock
library, add this to your project
Lastly, if you were using the compatibility support , you need to delete that jar since it's included in ActionBarSherlock.
按照以下步骤添加 HoloEverywhere
Follow the steps below to add HoloEverywhere
下载从GitHub上邮编到您的计算机 解压缩文件夹 转到Eclipse和选择文件&GT;新建 - &GT; Android项目
选择创建从现有的源
,然后项目浏览
到 HoloEverywhereLib
文件夹中提取的文件夹
preSS 完成
单击新创建的项目右键,然后转到属性
。
在该安卓
标题,你会看到一个部分库
有一个复选框 IsLibrary
。确保的Checked和preSS 添加
和previously添加库 ActionBarSherlock
。
Download Zip from GitHub to your computer
UnZip the folder
Go to eclipse and choose File->New-> Android Project
Select Create project from existing source
and then browse
to the HoloEverywhereLib
folder inside extracted folder
Press Finish
Right click on the newly created project and go to Properties
.
Under the Android
heading, you should see a section for Library
with a checkbox IsLibrary
. Make sure that's checked and press Add
and previously added library ActionBarSherlock
.
按照以下步骤添加 HoloEverywhere
到项目
Follow these steps to add HoloEverywhere
to your project
ActionBarSherlock
和 HoloEverywhere
更改 Android清单
来以下
Create a new Android project
Right Click on project -> Properties -> Android -> Add, add both ActionBarSherlock
and HoloEverywhere
Change the Android Manifest
to following
&lt;应用
机器人:图标=@可绘制/ ic_launcher
机器人:标签=@字符串/ APP_NAME
机器人:主题=@风格/ Holo.Theme&GT;
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Holo.Theme">
编辑您的main.xml
来包括全息主题的部件。
Edit you main.xml
to include Holo theme widgets.
更改活动
如下:
public class ChkActionBarSherlock extends SherlockActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}