记录requestFeature() must be called before adding content问题

Posted 隔壁小王66

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了记录requestFeature() must be called before adding content问题相关的知识,希望对你有一定的参考价值。

requestFeature() And supportRequestWindowFeature

requestFeature很常见,大家也经常在去掉标题栏的时候使用。

requestFeature() must be called before adding content

这个问题大家多少也了解,今天就笔叙一下遇到的问题

  1. 就是字面意思,requestFeature必须在setContentView之前调用
  2. requestFeature,在继承自Activity的类中用requestFeature
  3. supportRequestWindowFeature,在继承自AppCompatActivity中使用

第二个可能不是很常见,而且测试很大几率测试不出来,但是问题肯定存在,所以笔叙于此记录之。

以上是关于记录requestFeature() must be called before adding content问题的主要内容,如果未能解决你的问题,请参考以下文章