Bug 51741 - Xamarin Forms seems to be overriding the Appearance.SetTitleColor of a UIButton
Summary: Xamarin Forms seems to be overriding the Appearance.SetTitleColor of a UIButton
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.3.4
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-01-24 20:16 UTC by Wally McClure
Modified: 2017-05-24 00:48 UTC (History)
3 users (show)

Tags: uiappearance ios ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Wally McClure 2017-01-24 20:16:15 UTC
I've been working on an article on Xamarin.Forms and UI Customization.  One of the interesting pieces to me is the ability to style an XF application like iOS when running on iOS.  To test this out, I tried to do something really simple and set the title color of a button to be red.  I placed the following line in my iOS FinishedLaunching Event in the AppDelegate in my iOS application.
UIButton.Appearance.SetTitleColor(UIColor.Red, UIControlState.Normal);

I would expect the color of the buttons to be red when running on iOS.  The colors of the buttons are always blue in Xamarin.Forms.  My guess is that XF is always setting the buttons to blue on iOS since that is the general default in iOS.
Comment 1 Paul DiPietro [MSFT] 2017-03-21 19:52:53 UTC
This does look to be a legitimate issue from what I can tell -- I checked against the list of what supports UIAppearance (http://nshipster.com/uiappearance/ has a nice shortcut to show you what supports it) and if I create a new X.iOS application and use the SetTitleColor method, it changes the color of a UIButton placed on the main storyboard, while only the Stepper control looks to receive and particular effect in Forms. Checked against the latest 2.3.4 prerelease just to make certain.
Comment 2 Jimmy [MSFT] 2017-05-24 00:48:46 UTC
I tested with 2.3.5-pre3 and this appears to be resolved. The color set with UIButton.Appearance.SetTitleColor() is now applied to Buttons in the Xamarin.Forms app.