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

Button renderer and states

$
0
0

Hi, I've read a lot of code and example without finding anything really usefull.

I'm looking for a way to customize the appearance of a button depend on its state.

Right now, the only thing I managed to do is to change the TextColor on iOS only. I've found some working code in Android but it's using a deprecated method.

`
// In the public override void Draw(CGRect rect) method : I do :

// State Normal :
btn.SetTitleColor(Color.White.ToUIColor(), UIControlState.Normal);

// State Highlighted :
btn.SetTitleColor(Color.Yellow.ToUIColor(), UIControlState.Highlighted);

// State Disabled :
btn.SetTitleColor(Color.Gray.ToUIColor(), UIControlState.Disabled);`

How can I do with BackgroundColor ? Same question for Android ?
Does anyone still got a link / bookmark where it 's well explained ?

Thanks all.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>