去掉Android新建项目的顶部标题-application
源出处转载:https://blog.csdn.net/u012246458/article/details/52997727
为了以后自己方便找就复制了 感谢大神的源码
AndroidStudio新建项目会有默认的主题,默认主题是带等不标题的,项目中用不到,这时候就需要修改application的Theme了。
application的Theme起到全局作用:定义工具栏颜色等。
图片:
原图:
修改后
代码:只用修改styles中的代码即可。(其实就是DarkActionBar修改成NoActionBar)
原Styles.xml
<!-- Base application theme. -->
<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>
</style>
修改后Styles.xml:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>