ActionBar简要
来源:互联网 发布:淘宝9秒视频在线制作 编辑:程序博客网 时间:2024/04/29 12:19
1.0:AcntionBar是谷歌在Android3.0后加入的新功能,在不使用第三方Jar包的情况下注意版本
2.0:通过getActionBar().setDisplayShowHomeEnabled(false);可以单独隐藏actionBar的图标,标题文字也是同理。
3.0很多手机默认不显示左边的Menu,这里就需要通过反射来让Menu强制显示
ViewConfiguration config = ViewConfiguration.get(this);
Field menueKey = ViewConfiguration.class .getDeclaredField("sHasPermanentMenuKey"); menueKey.setAccessible(true); menueKey.setBoolean(config, false);
4.0:图标同理
if (featureId == Window.FEATURE_ACTION_BAR && menu != null) { if (menu.getClass().getSimpleName().equals("MenuBuilder")) { try { Method m = menu.getClass().getDeclaredMethod( "setOptionalIconsVisible", Boolean.TYPE); m.setAccessible(true); m.invoke(menu, true); } catch (Exception e) { e.printStackTrace(); } } }
5.0:Menu的事件通过onOptionsItemSelected来进行监听
0 0
- ActionBar简要
- 从源码角度简要分析ActionBar框架
- 从源码角度简要分析ActionBar框架
- ActionBar
- ActionBar
- ActionBar
- Actionbar
- ActionBar
- actionbar
- actionBar
- actionbar
- ActionBar
- ActionBar
- ActionBar
- ActionBar
- ActionBar
- ActionBar
- actionbar
- A Probabilistic Graphical Model-based Approach for Minimizing Energy Under Performance Constraints
- hdu 4578 Transformation 2013ACM-ICPC杭州赛区全国邀请赛
- OneNote2013 代码语法高亮插件
- acdream 1092 EOF女神的打地鼠游戏 (概率dp)
- MAC笔记本下Android 反编译apk文件最新版本
- ActionBar简要
- 如何使用ApkPlug插件化我的第一个应用
- C\C++ 向下\向上取整函数 floor() ceil()
- eclipse的java源码关联
- 欧拉计划(9)Special Pythagorean triplet
- nagios二次开发(六)---nagiosql原理及主要文件的介绍
- POJ3321 Apple Tree
- Java反射机制分析指南
- Linux命令行(console)屏幕分辨率调整