自动创建的AppTheme为:
<!-- 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>
修改后的:
<!-- Base application theme. -->
<style name="NoActionBar" 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>
AndroidManifest.xml中修改如下
android:theme="@style/NoActionBar"
本文介绍如何在Android应用中自定义AppTheme,通过修改styles.xml文件中的样式,实现去除ActionBar的效果,并在AndroidManifest.xml中应用新的主题设置。
6万+

被折叠的 条评论
为什么被折叠?



