I am following developer.android.com Android development tutorials and am currently trying to create a stylish action bar using the information provided here: https://developer.android.com/training/basics/actionbar/styling.html# CustomBackground7
Here's the res / values /themes.xml code:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CustomActionBarTheme" parent="@android:style/Theme.AppCompat.Light.DarkActionBar"> <item name="android:actionBarStyle">@style/MyActionBar</item> <item name="actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@android:style/Widget.AppCompat.Light.ActionBar.Solid.Inverse"> <item name="android:background">@drawable/actionbar_background</item> <item name="background">@drawable/actionbar_background</item> </style> </resources>
I see icons with a red cross next to the opening style tags that hang on which the error message appears: error: error getting the parent element for the element: the resource was not found that matches the specified name "@android: style / Theme.AppCompat. Light.DarkActionBar "
- My application has minSdkVersion = "11" and targetSdkVersion = "21", I tried to change minSdkVersion to 13, 14, but that didn't matter
- Someone suggested checking if appcompat was marked as a library project or not, I checked it, and the isLibrary option was checked in the appcompat properties window.
- I also made sure that appcompat was added to my project as a library project.
- removing @android from @android: style or deleting @ does not work. However, in the first style tag, when I delete "@android", the red cross disappears, but this does not happen for the second style tag.
Please, help. I was with him in the morning, and I will not go anywhere.
source share