Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Customizing the Android Button

$
0
0

I am having a real difficult time finding and figuring out how to do a couple things specific to Android buttons in Xamarin.Forms.

How do I add a border? I seen this post http://stackoverflow.com/questions/17564884/is-it-possible-to-specify-border-in-android-button that explains it with Xaml but I am assuming this is possible with Xamarin.Forms as I have found Drawable types but nothing that really matched what is described here.

How do I use the ColorStateList? I cannot find any documentation and the parameter is an array of int which doesn't tell me much. It looks like you can grab a color by passing in a state as well but I cannot figure out what is needed to set the list of ColorStates to have them returned.

Is there button state? The ColorStateList makes me feel like that is the way I would handle state appearances but I don't see a real state property. Currently I have implemented an enum I made for the state and I am checking IsEnabled and IsFocused to figure out the state but is there a better way to do this?

Examples or resource links are welcome as I am not having much luck googling and searching these forums. Thank you.


Viewing all articles
Browse latest Browse all 58056

Trending Articles