Android 错误:未找到属性';流行语';“包装内”;com.example…“;

Android 错误:未找到属性';流行语';“包装内”;com.example…“;,android,compiler-errors,attributes,resources,identifier,Android,Compiler Errors,Attributes,Resources,Identifier,有很多类似的问题,但我没有具体说明我的代码。他们中没有人为此而工作 我正在尝试添加工具栏,如图所示 但这对我不起作用,因为它显示了错误 在包“com.example…”中未找到属性“poputheme”的资源标识符。 我的代码是这样的: 活动\u main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com

有很多类似的问题,但我没有具体说明我的代码。他们中没有人为此而工作

我正在尝试添加工具栏,如图所示

但这对我不起作用,因为它显示了错误

在包“com.example…”中未找到属性“poputheme”的资源标识符。

我的代码是这样的:

活动\u main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/LinearLayoutMain"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<android.support.v7.widget.Toolbar
    android:id="@+id/my_toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:elevation="4dp"
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</RelativeLayout>

我还添加了
appcompat
cardwiew
库,但仍然出现相同的错误


有人知道答案吗?请回答。

在style.xml中定义以下样式

 <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />


希望它能帮助您。

在style.xml中定义以下样式

 <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

希望它能帮助您。

从app:style中删除app 而且风格

@颜色/绿色
@style/ThemeOverlay.AppCompat.Light
@style/ThemeOverlay.AppCompat.Dark
它应该很好用 勾选正确答案,谢谢

从app:style中删除app 而且风格

@颜色/绿色
@style/ThemeOverlay.AppCompat.Light
@style/ThemeOverlay.AppCompat.Dark
它应该很好用
勾选正确答案,谢谢

Hi Vidhi,除非您也共享java代码,否则无法调试此功能。如果您可以共享logcat堆栈跟踪,那么它会更好。可能您在java代码中弄乱了一些布局膨胀。尽管在xml中,您可以尝试删除两个主题属性。这可能会给您带来一些恢复ult没有错误。Hi Vidhi,除非您也共享java代码,否则无法调试此功能。如果您可以共享logcat堆栈跟踪,那么它会更好。可能您在java代码中弄乱了一些布局膨胀。尽管在xml中,您可以尝试删除这两个主题属性。这可能会给您带来一些结果而不会出错R
    app:popupTheme="@style/AppTheme.PopupOverlay"