error: resource style/AppTheme (aka com.example.myapplication:style/AppTheme

解决:一不小心把app/src/main/res/values/styles.xml下的内容删了,加一个即可:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
	<!-- Customize your theme here. -->
	<item name="colorPrimary">#A000</item>   <!-- 设置顶部的标题的颜色 -->
	<item name="colorPrimaryDark">#8000</item>    <!-- 设置标题上面的背景颜色 -->
	<item name="colorAccent">#00f</item>   <!-- 输入框和按钮单选框的响应颜色 -->
</style>

顺便补上colors.xml和strings.xml的内容。

string.xml:

<resources>
    <string name="app_name">My Application</string>
</resources>

colors.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="purple_200">#FFBB86FC</color>
    <color name="purple_500">#FF6200EE</color>
    <color name="purple_700">#FF3700B3</color>
    <color name="teal_200">#FF03DAC5</color>
    <color name="teal_700">#FF018786</color>
    <color name="black">#FF000000</color>
    <color name="white">#FFFFFFFF</color>
</resources>
posted @ 2021-10-14 21:05  nerd`  阅读(118)  评论(0编辑  收藏  举报