I am trying to design a new theme for my android application in C# in Xamarin. I have followed a few tutorials and answers on this but I keep getting the error
No resource found that matches the given name (at 'theme' with value '@android:style/Theme.CustomActionBarTheme')
I have check a few of the relevant answer for this error but none seem to work for me :(
Heres my xml code which is located in my Values folder under Resources: Styles.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style
name="AppBaseTheme"
parent="android:Theme.Holo.Light">
</style>
<style
name="CustomActionBarTheme"
parent="@android:style/Theme.Holo.Light.DarkActionBar">
<item
name="android:actionBarStyle">@style/MyActionBar
</item>
</style>
<style
name="MyActionBar"
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item
name="android:background">#033C73
</item>
</style>
</resources>
Can anyone help me out a bit?
Thanks
EDIT * So here is the top of my MainActivity.cs
[Activity(Label = "My App", MainLauncher = true, Icon = "@drawable/icon", Theme = "@android:style/Theme.CustomerActionBarTheme")] public class MainActivity : Activity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); }
Where is your theme Theme.CustomActionBarTheme ? You call it but it doesn't exist
Did you make changes in your manifest file
<application
android:theme="@style/CustomActionBarTheme" >
</application>
Now you must be declaring it as
android:theme="@android:style/CustomActionBarTheme" >
Change to:
[Activity(Label = "My App", MainLauncher = true, Icon = "@drawable/icon", Theme = "@style/Theme.CustomActionBarTheme")]
public class MainActivity : Activity
...
You have misspelled your theme name ( CustomerActionBarTheme
instead of CustomActionBarTheme
) and Theme style is declared without the android:
prefix
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.