导航:首页 > 操作系统 > androidactionbar搜索

androidactionbar搜索

发布时间:2022-06-30 06:03:17

‘壹’ 如何使用android-support-V7包中ActionBar

以前3.0以前的版本要使用ActionBar,必须使用国外大牛写的ActionBarSherlock这个开源项目。今年的Google/IO大会之后,Gooogle官方在android-support-v 7包中添加了ActionBar,开始让2.1以后的版本支持ActionBar,从此以后曾经最火的Android开源项目ActionBarSherlock可以退出历史舞台了。

要是用V7包中ActionBar也很简单,但有一个需要主要的地方。有些人可能该开始仅仅是把android-support-v7-appcompat.jar导入项目中

具体使用 步骤 (针对于Eclipse):

Create a library project based on the support library code:

Make sure you have downloaded the Android Support Library using the SDK Manager .
Create a library project and ensure the required JAR files are included in the project's build path:
Select File > Import .
Select Existing Android Code Into Workspace and click Next .
Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the appcompat project, browse to <sdk>/extras/android/support/v7/appcompat/ .
Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat .
In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path . For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path.
Right-click the project and select Build Path > Configure Build Path .
In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
Uncheck Android Dependencies .
Click OK to complete the changes.

‘贰’ Android怎样在Actionbar作出一个返回上一个activity按钮

箭头是
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
,点击要在onOptionsItemselected里面根据android.R.id.home重写。
搜索框是optionsmenu中设置为SearchView

阅读全文

与androidactionbar搜索相关的资料

热点内容
cpp编译解决命名冲突问题 浏览:507
单片机的晶振频率 浏览:481
翻样软件加密锁问题 浏览:204
电脑怎么设置dhcp服务器地址 浏览:591
十天突破雅思写作剑8pdf 浏览:354
如何判定服务器硬盘烧了 浏览:243
数值逼近pdf 浏览:706
程序员跪键盘 浏览:3
江苏银行app换设备电话按哪个键 浏览:235
图片无损压缩怎么办 浏览:6
如何确认服务器的光口网卡 浏览:243
nb1111y压缩机性能数据 浏览:549
下一代编译器 浏览:131
用什么app可以查产品批号 浏览:436
python自动补齐 浏览:904
苹果wifi安卓怎么连接不上 浏览:934
为什么有的app只能用苹果支付 浏览:175
手游云顶文件夹 浏览:939
msvc和mingw都是编译器吗 浏览:427
数控机床编程解析 浏览:387