去掉标头的方式

来源:互联网 发布:域名的ip地址查询 编辑:程序博客网 时间:2024/04/29 16:20

都要在setContentView(R.layout.main_activity);之前添加
方式1在代码中加入

        requestWindowFeature(Window.FEATURE_NO_TITLE);

方式2样式添加
现在style.xml中添加样式

<style name="Li" parent="Theme.AppCompat.Light.DarkActionBar">        <!-- Customize your theme here. -->        <item name="windowActionBar">false</item>        <item name="windowNoTitle">true</item></style>

在代码中调用

setTheme(R.style.Li);
0 0