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 ...
随机推荐
- mac os+selenium2+chrome驱动+python3
mac os 10.11.5 mac自带python2.7,自己下载了python3.5,pip list查看系统中的安装包,本人电脑中已经安装了pip和setuptools,若未安装,请先使用 su ...
- Hibernate中的条件查询完毕类
Hibernate中的条件查询有下面三个类完毕: 1.Criteria:代表一次查询 2.Criterion:代表一个查询条件 3.Restrictions:产生查询条件的工具类
- odoo费用报销流程
- VueJS样式绑定:v-bind
HTML <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <titl ...
- mysql创建还原点
set autocommit = 0; insert into t1(name) values ("user1"); savepoint p1; insert into t ...
- Mysql 基本操作指令+增删查改
nqinx是web前端服务端 负载均衡(软件)可以将用户请求调度到几台机器的nqinx上去做 ,一般都有两个负载均衡,一个做备用硬件的要比软件的好,但是一般公司都用软件实现数据库软件其实也是一个服务端 ...
- import caffe时出错:can not find module skimage.io
import caffe时出错:can not find module skimage.io //以下内容在ubuntu16.4上实际验证过.注意大小写的.----20170605 在命令行输入Py ...
- WWDC2014苹果的“软件”发布会
WWDC 2014 苹果的"软件"发布会 在今年的 6 月 2 日到 6 日,苹果照例举行了一年一次的全球开发者大会(World Wide Developer Conference ...
- python staticmethod和classmethod(转载)
staticmethod, classmethod 分别被称为静态方法和类方法. staticmethod 基本上和一个全局函数差不多,只不过可以通过类或类的实例对象(python里只说对象总是容易产 ...
- Spring mvc接受集合类型参数的方法
public String xxxxx(String xxxx, String xxxxx, @RequestParam("parameterList[]") List<St ...