requestWindowFeature(Window.FEATURE_NO_TITLE)无效解决方法
2016-07-15 10:48
751 查看
requestWindowFeature(Window.FEATURE_NO_TITLE)无效解决方法
正常情况下requestWindowFeature(Window.FEATURE_NO_TITLE)是可以生效的,但是当Activity继承子AppCompatActivity的时候,这个就失效了解决办法:
// 手动在oncreate里hide()actionbar if (getSupportActionBar() != null){ getSupportActionBar().hide(); } // 第二种最简单 直接用supportrequestwindowFeature好了: supportRequestWindowFeature(Window.FEATURE_NO_TITLE); // 第三种 直接修改style 缺点 直接全局了(注意继承) <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="android:windowActionBar">false</item> <item name="android:windowNoTitle">true</item> </style>
相关文章推荐
- 【leetcode】62. Unique Paths
- RequireJS 基础(一)
- error: Malformed value for push.default: 无
- UITableViewCell点击事件无法响应问题
- EasyUI常用组件(基础)
- EasyUI常用组件(基础)
- EasyUI常用组件(基础)
- iOS UILabel:宽度固定,自动高度显示全部文字
- Errors running builder 'DeploymentBuilder' on project 'webdemo'.java.lang.NullPointerException
- iphone-命令行编译之--xcodebuild
- layui点击打开图片窗口
- Installation error: INSTALL_FAILED_UID_CHANGED 的解决办法
- 2016.07.14,英语,《Vocabulary Builder》Unit 25
- Controlling A Roomba with an Arduino - Arduino串口控制Roomba教程
- LINK : fatal error LNK1000: Internal error during IncrBuildImage 解决方法
- Building a Jabber Client for iOS: Interface Setup
- 小工具,控件,UI
- 李洪强iOS开发之拓展篇—UIDynamic(简单介绍)
- ZHA Coordinator 如何控制ZLL Light/Philips Hue Light
- gpuimage的各种滤镜简介