安卓开发——requestFeature() must be called before adding content
2016-02-03 01:02
519 查看
今天在学习安卓开发时,为了实现取消标题栏,便在onCreate()里加了句requestWindowFeature(Window.FEATURE_NO_TITLE);
如图
巴特,载到手机上时,却异常退出。logcat一直报错
真是百思不得其解,我明明就是before,并没有after呀。
后来百度得知是由于我用的是Google最新的开发工具,继承的是ActionBarActivity,改成继承Activity就完美解决了。
//取消标题栏
requesteWindowFeature(Window.FEATURE_NO_TITLE);
//取消状态栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
如图
巴特,载到手机上时,却异常退出。logcat一直报错
真是百思不得其解,我明明就是before,并没有after呀。
后来百度得知是由于我用的是Google最新的开发工具,继承的是ActionBarActivity,改成继承Activity就完美解决了。
//取消标题栏
requesteWindowFeature(Window.FEATURE_NO_TITLE);
//取消状态栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
相关文章推荐
- 重温Servlet学习笔记--request对象
- poj 2031 Building a Space Station(最小生成树)
- An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.
- ios上 更改 状态栏(UIStatusBar)的颜色
- cue2audio
- iOS开发之UIAlertView与UIAlertController的详尽用法说明
- iOS 7中使用UINavigationController进行pop崩溃
- 【XJBG】UESTCdp练习场 D 温泉旅馆
- iOS 【UIKit-UIImage渲染模式 imageWithRenderingMode:】
- iOS 【UIKit-文本属性 Attributes】
- CDOJ 1273 God Qing's circuital law
- Error installing mysql2: ERROR: Failed to build gem native extension
- Arduino接口-week4-Lesson1
- UITableView 查询结果为空,显示无数据的方法
- Fuel Openstack 7.0在Virtualbox中部署
- 1017. Queueing at Bank (25)
- 环状序列(Circular Sequence, ACM/ICPC Seoul 2004, UVa1584)
- JDBC获得数据库连接时写在URL上的?useUnicode=true&characterEncoding=utf-8的意义
- UESTC 1272 Final Pan's prime numbers(乱搞)
- Number Sequence