When trying to change the selector for a ListView programmatically to any color I want, I discovered that I am unable to make my own drawable in code.
When looking at the definition for the Android AbsListView in Xamarin, the method SetSelector(Drawable drawable) that is referenced https://developer.android.com/reference/android/widget/AbsListView.html#setSelector(android.graphics.drawable.Drawable) is not available.
I believe it should be.
Thank you for the report. This is one of the cases where we provide the int method and not the Drawable method.
For example, you won't see this method in the following documentation:
The only method you'll find is the following:
There are many ways to workaround this by using the Int32 method, but it would be nicer to have a Drawable one exposed. Thus I am marking this issue as CONFIRMED.
Use the Resources.GetIdentifier method to get the respective identifier of the item, or use the Resource.drawable.resourcename
Now that this bug is CONFIRMED, we will get some Android Engineering eyes on it. Thanks again for the report!
My main problem is that I cannot use a programmatically created drawable, so I have to have something premade in the XML. That is not always the case, especially for Forms projects, where I am looking to use this.