Iam doing toolbar Graduint color at xamarin android but i got always error

emadyounanemadyounan Member ✭✭
edited February 8 in Xamarin.Android

Java.Lang.RuntimeException: 'Unable to start activity ComponentInfo{com.companyname.petrol_stations_in_egypt/crc64d6a5ab320b9d9d63.MainActivity}: android.content.res.Resources$NotFoundException: Can't find ColorStateList from drawable resource ID #0x7f070067

my code is
at mystyle file

      <style name="MyCustomTheme" parent="android:Theme.Material.Light">
        <item name="android:colorPrimary">@drawable/mygradient</item>
      </style>

my graduint file

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle"
    android:useLevel="false" >

  <gradient
      android:angle="90"
      android:startColor="#f91088"
      android:endColor="#f8343a"
      android:type="linear" />

</shape>

mymain active

[Activity(Label = "@string/Login", Theme = "@style/MyCustomTheme", MainLauncher = true)]

Best Answer

Answers

  • emadyounanemadyounan Member ✭✭

    Yup I tried your answer and it works well
    thanks :smile:

Sign In or Register to comment.