Learning Android ActionBar
PART1:Make Android2.1 Support ActionBar
Last evening I learnt how to make android2.1 support actionbar from Android Developers.The page is HERE,Click.
To sum up , I briefy illustrate the main steps:
1.Add the v7 appcompat library , which is not just a jar file but a library with resources.
2.Let the Activities that originally extending "Activity" to extend "ActionBarActivity".
3.In your manifest file, update either the <application> element or individual <activity> elements to use one of the Theme.AppCompat themes. For example:
That's it.
BTW,if you wanna know what the Theme.AppCompat themes contain, "Alt + /" is not capable , you can find them also on Android Developers,
Thme.AppCompat.For example, you find
public static int Theme_AppCompat_Light_DarkActionBar,
then you should change the theme like this:
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
keep in mind that the first letter in each word should be its upper class form.
PART2:Adding Action Buttons
Android Developers says the most important buttons should be set on the ActionBar, buttons that are not so important should be placed in the Overflow Button.
------Met a Problem----
After adding a key-value pair in strings.xml file, MainActivity.java pointed out that R.java can't be found.So open "gen" folder,sure enough R.java is missing.Checking the xml file,I found in <string name="action_search">Search!!</string>, the "s" in the string was written as a upper class form.change it back to lower, R.java returned.Problem solved.
------------------------
Learning Android ActionBar的更多相关文章
- [Xamarin.Android] ActionBar Tips
[Xamarin.Android] ActionBar Tips ActionBar用途 快速搞懂 ActionBar的用途,可以参考下列文章: [Android]使用 ActionBarCompat ...
- Android ActionBar详解
Android ActionBar详解 分类: Android2014-04-30 15:23 1094人阅读 评论(0) 收藏 举报 androidActionBar 目录(?)[+] 第4 ...
- Android ActionBar(转)
本文内容 关于 ActionBar 必要条件 项目结构 环境 演示一:Action Bar 显示隐藏 演示二:Action Item 显示菜单选项 演示三:Action Home 启用“返回/向上”程 ...
- Android ActionBar应用实战,高仿微信主界面的设计
转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/26365683 经过前面两篇文章的学习,我想大家对ActionBar都已经有一个相对 ...
- Android ActionBar完全解析,使用官方推荐的最佳导航栏(下) .
转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/25466665 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工 ...
- Android ActionBar完全解析,使用官方推荐的最佳导航栏(上)
转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/18234477 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工 ...
- Android ActionBar全然解析,使用官方推荐的最佳导航栏(上)
转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/18234477 本篇文章主要内容来自于Android Doc.我翻译之后又做了些加工 ...
- Android 原生 Android ActionBar
本文内容 关于 ActionBar 必要条件 项目结构 环境 演示一:Action Bar 显示隐藏 演示二:Action Item 显示菜单选项 演示三:Action Home 启用"返回 ...
- Android Actionbar Tab 导航模式
Android Actionbar Tab 下图中,红色矩形圈起来的就是我们 ActionBar Tab,下面我们将一步一步的实现下图中的效果. 初次尝试 package com.example.it ...
随机推荐
- 临远的activiti教程
1. 简介 协议 下载 源码 必要的软件 JDK 6+ Eclipse Indigo 和 Juno 报告问题 试验性功能 内部实现类 2. 开始学习 一分钟入门 安装Activiti 安装Activi ...
- Keras使用的一些细节
1.Keras输出的loss,val这些值如何保存到文本中去: Keras中的fit函数会返回一个History对象,它的History.history属性会把之前的那些值全保存在里面,如果有验证集的 ...
- NATSserver配置具体解释
NATSserver配置具体解释 作者:chszs,未经博主同意不得转载. 经许可的转载需注明作者和博客主页:http://blog.csdn.net/chszs 虽然NATS能够无配置的执行,但也能 ...
- js随机数 从头开始系列
js要常常写啊要不然就要从0开始 1 var num = Math.random(); //创建一个0-1随机数字 num*=10 //变为0-10随机数字 //有好几种取整方式 var i = Ma ...
- mysql复制表命令
http://hi.baidu.com/dwspider/item/908bf5e1746275bd2e140b03 上面命令是实现复制表的一种方法,缺陷就是索引等表信息不会复制过去,只是复制 ...
- AMD单桥主板上电时序的详细解释
3个待机条件: 1.桥需要得到待机电压:3.3V,1.5V/1.2V2.25M起振注:NV的RTC电路,一般不会导致时序故障,都可以出CPURST#3.PWRGD-SB(即INTEL芯片组的RSMRS ...
- 生产追溯系统-Wifi+传感器,实现计数器以及监控机器是否停止
物联网听上去是一个高大上的词儿,还有什么大数据.云.智能制造等等,今天我也往这方面稍微靠一靠,这篇文章主要介绍的是通过 wifi 模块与传感器组合,实现感应计数器,应用场景主要如下: 1.统计 SMT ...
- Web性能测试工具:Siege安装&使用简介
在Web性能测试工具中,siege是比较热门和常见的,它有安装简单,使用简单,测试报告详细的特点. 并且可以在文本中预定义一系列待测试url模拟,并可设定一定并发量下持续指定时间or测试进行测试. 比 ...
- 如何清除本地DNS缓存 windows
在您的网站迁移服务器时需要对域名所指向的IP进行更改,这时候在本机访问网站时就需要清除本地的DNS缓存信息,那么怎样清除呢? 首先我们应该明白清除DNS缓存信息的原理:当计算机对域名访问时并不是每次访 ...
- iOS开发工具篇-AppStore统计工具
本文转载至 http://mobile.51cto.com/hot-418183.htm 随着iOS开发的流行,针对iOS开发涉及的方方面面,早有一些公司提供了专门的解决方案或工具.这些解决方案或工具 ...