AppCompatActivity和Activity的区别
首先是AppCompatActivity默认带标题
但Activity不带
而且AppCompatActivity和
requestWindowFeature(Window.FEATURE_NO_TITLE);
有冲突
当活动继承AppCompatActivity时再设置取消标题则程序会直接挂掉
即以下程序无法正常运行
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
}
}
---------------------
作者:S_ubs
来源:CSDN
原文:https://blog.csdn.net/s_ubs/article/details/50821390
版权声明:本文为博主原创文章,转载请附上博文链接!
原文地址:https://www.cnblogs.com/otaganyuki/p/10355981.html
时间: 2024-10-25 04:47:41