去掉Android新建项目的顶部标题-application:Theme
2016-11-01 17:16
393 查看
说明:
AndroidStudio新建项目会有默认的主题,默认主题是带等不标题的,项目中用不到,这时候就需要修改application的Theme了。application的Theme起到全局作用:定义工具栏颜色等。
图片:
原图:修改后图:
代码:只用修改styles中的代码即可。
原AndroidManifest.xml<?xml version="1.0" encoding="utf-8"?> <manifest package="mandao.component" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest>原Styles.xml
<resources> <!-- 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> </resources>
修改后Styles.xml:
<resources> <!-- 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> </resources>
相关文章推荐
- 去掉Android新建项目的顶部标题
- 新建Android项目的时候去掉对appcompat_v7项目的依赖
- Android studio 不能新建application 项目
- 新建Android项目报错"No resource found that matches the given name 'Theme.AppCompat.Light'."
- android 新建项目中去掉标题栏
- eclipse 新建Android项目的出现Enter an application name (shown in launcher)
- Android新建项目选择SDK的区别(MiniMum Required SDK; Target SDK; Compile With; Theme )
- Android新建Activity Theme设置无标题
- 新建Android项目时避免继承ActionBarActivity并去掉titleBar
- android去掉标题和状态栏的方法
- 新建Android项目时使用project from existing source导入已经存在的项目报 AndroidManifest.xml file missing错误解决方案
- 如果新建的android项目前面有红叉或者感叹号怎么办
- 之前的android项目报错,新建android项目报错,代码中找不到错误
- 新建Android项目时使用project from existing source导入已经存在的项目报 AndroidManifest.xml file missing错误解决方案
- 新建ArcGIS Project for Android项目失败解决方案
- Eclipse IDE中Android新建项目打红叉的解决方法
- Import android项目或者新建Exsiting project时,出错提示 overlaps the location of another project
- Android去掉标题,强制设置横屏或竖屏
- ADT_20新建项目Android Support library not installed问题
- Android去掉标题,强制设置横屏或竖屏