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的更多相关文章

  1. [Xamarin.Android] ActionBar Tips

    [Xamarin.Android] ActionBar Tips ActionBar用途 快速搞懂 ActionBar的用途,可以参考下列文章: [Android]使用 ActionBarCompat ...

  2. Android ActionBar详解

    Android ActionBar详解 分类: Android2014-04-30 15:23 1094人阅读 评论(0) 收藏 举报 androidActionBar   目录(?)[+]   第4 ...

  3. Android ActionBar(转)

    本文内容 关于 ActionBar 必要条件 项目结构 环境 演示一:Action Bar 显示隐藏 演示二:Action Item 显示菜单选项 演示三:Action Home 启用“返回/向上”程 ...

  4. Android ActionBar应用实战,高仿微信主界面的设计

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/26365683 经过前面两篇文章的学习,我想大家对ActionBar都已经有一个相对 ...

  5. Android ActionBar完全解析,使用官方推荐的最佳导航栏(下) .

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/25466665 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工 ...

  6. Android ActionBar完全解析,使用官方推荐的最佳导航栏(上)

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/18234477 本篇文章主要内容来自于Android Doc,我翻译之后又做了些加工 ...

  7. Android ActionBar全然解析,使用官方推荐的最佳导航栏(上)

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/18234477 本篇文章主要内容来自于Android Doc.我翻译之后又做了些加工 ...

  8. Android 原生 Android ActionBar

    本文内容 关于 ActionBar 必要条件 项目结构 环境 演示一:Action Bar 显示隐藏 演示二:Action Item 显示菜单选项 演示三:Action Home 启用"返回 ...

  9. Android Actionbar Tab 导航模式

    Android Actionbar Tab 下图中,红色矩形圈起来的就是我们 ActionBar Tab,下面我们将一步一步的实现下图中的效果. 初次尝试 package com.example.it ...

随机推荐

  1. xamarin android 获取根证书代码

    Java.Security.KeyStore keyStore = Java.Security.KeyStore.GetInstance("AndroidCAStore"); ke ...

  2. Android --修改arr文件

    1. 改为zip文件 2. 修改 3. 改后缀

  3. Android入门:MVC模式(中)

    MVC 模式的最基本概念是分层设计,把我们的代码基于 View(视图).Model(模型).Controller(控制器)进行分类封装,这样做的目的是为了清晰结构,使代码更易维护和扩展. 在上一篇文章 ...

  4. [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

    一.背景 最近的项目在用maven 进行install的时候,发现老师在控制台输出警告:[WARNING] Using platform encoding (UTF-8 actually) to co ...

  5. [反汇编练习] 160个CrackMe之033

    [反汇编练习] 160个CrackMe之033. 本系列文章的目的是从一个没有任何经验的新手的角度(其实就是我自己),一步步尝试将160个CrackMe全部破解,如果可以,通过任何方式写出一个类似于注 ...

  6. poj-3744-Scout YYF I-矩阵乘法

    f[i]=f[i-1]*p+f[i-2]*(1-p); 正好能够用矩阵加速. . . . #include<stdio.h> #include<string.h> #inclu ...

  7. Highcharts常用的最核心的参数选项配置详细说明

    Highcharts提供大量的选项配置参数,您可以轻松定制符合用户要求的图表,目前官网只提供英文版的开发配置说明文档,而中文版的文档网上甚少,且零散不全.这里,我把Highcharts常用的最核心的参 ...

  8. react 监听 移动端 手机键盘 enter 事件

    处理方法: (1)html书写 form标签中去掉action参数,定义onSubmit方法,如下所示: /** * 搜索框 组件 */ import React,{PureComponent} fr ...

  9. d3js 获取元素以及设置属性

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8&quo ...

  10. MyEclipse 设置智能提示

    choice 1: -->window→Preferences→Java→Editor→Content Assist, --->将Auto activation delay 的数值改为一个 ...