如何在手机有menu的物理按键的情况下,还将菜单显示在标题栏?
2016-07-01 15:16
405 查看
在添加菜单前,调用一下如下代码,大部分都能成功
try{ ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); if (menuKeyField != null) { menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Ignore }
相关文章推荐
- Altium Designer高级功能初探之:覆铜规则
- 使用Visual Studio编译Geos
- Linux环境下写一个进度条
- Undefined symbols for architecture arm64:
- 文件上传的渐进式增强
- Nginx 模块自主开发八: 总结 Nginx框架的流程
- aspx文件的构成
- MySql5.6使用validate password 插件加强密码强度的安装及使用方法
- 中文乱码解决方法
- leetcode8. String to Integer (atoi) & 探讨补码运算溢出
- 微信红包的算法实现探讨
- Why Redis beats Memcached for caching
- iOS开发者帐号申请指南
- 《Spring In Action》 读书笔记(5) -- @autowire,@Qualifier减少xml配置
- css样式
- [ios]移除当前视图下的所有子控件
- 回车 换行
- DatabaseFactory.CreateDatabase 方法操作数据库
- IMEI是什么? 怎样查手机串号IMEI
- 多线程中的条件变量和虚假唤醒(Spurious wakeup)