Thanks Jon, I think I was on 4.1.something before.

I could have sworn I tried your example before posting to the list and
it was throwing errors, but it now works fine! 

Thanks for your help,

Martyn

-----Original Message-----
From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: 19 July 2012 15:22
To: Discussions related to Mono for Android
Subject: Re: [mono-android] SetBackGroundColor, SetTextColor

On Jul 19, 2012, at 5:37 AM, Martyn Wendon wrote:
> Just upgraded to the latest stable and found that previous working
color setting seems to be broken:

What version were you using previously? Something before 4.2.0? 4.2.0
changed many methods which took a "color" and replaced `int` with
`Color`:

        
http://docs.xamarin.com/android/Releases/Mono_For_Android_4/Mono_for_And
roid_4.2#Breaking_Changes
        
http://docs.xamarin.com/Android_Api_Changes/Release_4.2.0/Level_4_Diff/M
onoAndroid.dll#Type_Changed.3a_Android.App.Activity
        ...

> int colour = Color.Argb(200, 50, 100, 150); 
> SomeLayout.SetBackgroundColor(colour);
> SomeTextView.SetTextColor(colour);

As of 4.2.0, this needs to be:

        Color colour = new Color (200, 50, 100, 150);
        SomeLayout.SetBackgroundColor (colour);
        SomeTextView.SetTextColor (colour);

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud
service.
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to