No resource identifier found for attribute 'startcolor' in package 'android'

nisathesharpnisathesharp Member
edited June 2018 in Xamarin.Android

I am using xamarin to create an android app. The following is an xml file I have created:

<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="schemas.android.com/apk/res/android"     xmlns:app="schemas.android.com/apk/res-auto" 
>
  <item>
    <shape android:shape="rectangle">
      <corners android:radius="50dp"/>
      <solid android:color="#FDFDFE"/>
      <size android:height="35dp"/>
      <gradient android:startcolor="#71DA98" android:endcolor="#56C5ED"/>
    </shape>
  </item>
</selector>

I have two errors:
No resource identifier found for attribute 'startcolor' in package 'android'
No resource identifier found for attribute 'endcolor' in package 'android'

The gradient is for a button. Any help appreciated.

Answers

  • robbitrobbit CNMember Xamurai

    Hi @nisathesharp ,

    Please try this:

        <?xml version="1.0" encoding="utf-8" ?>
        <selector xmlns:android="schemas.android.com/apk/res/android">
    
            <item>
    
                <shape xmlns:android="http://schemas.android.com/apk/res/android"
                    android:shape="rectangle">
    
                    <corners android:radius="50dp" />
                    <solid android:color="#FDFDFE"/>
                    <size android:height="35dp"/>
                    <gradient
                        android:startColor="#71DA98"
                        android:endColor="#56C5ED"/>
                </shape>
            </item>
        </selector>
    
Sign In or Register to comment.