Bug 20740 - UINavigationBar.Appearance.TintColor available in iOS5 not 7
Summary: UINavigationBar.Appearance.TintColor available in iOS5 not 7
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: master
Hardware: Macintosh Mac OS
: Low minor
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-06-19 18:46 UTC by Alicia Tams
Modified: 2014-07-04 01:49 UTC (History)
5 users (show)

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 for Bug 20740 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Alicia Tams 2014-06-19 18:46:42 UTC
Appearance.TintColor on bars is available in iOS 5 at the earliest. the green hint squiggly is just an annoyance. :-)

Obviously this is not a priority bug in the slightest.
Comment 1 Ram Chandra 2014-06-20 05:13:50 UTC
I have check this issue and I am getting the same behavior. 

Here is my observations:

In iOS 6 and earlier we were able to tint bar backgrounds using:

                UINavigationBar.Appearance.TintColor = UIColor.Green;

However, iOS 7 introduce a new property i.e. "BarTintColor", this property is used to tint the bar background, while TintColor is now used to tint the bar button items.

  UINavigationBar.Appearance.BarTintColor = UIColor.Green;    //bar background
  UINavigationBar.Appearance.TintColor = UIColor.Red;            //Tint color of button items

If you are using iOS7, please use "BarTintColor" to change the bar background.

Screencast: http://www.screencast.com/t/sJQgZInYtf

Please let me know if this fix your issue.

Environment Info:

Mac OS X 10.9.3

Xamarin Studio: 5.1.1 (build 0)
=== Build Information ===
Release ID: 501010000
Git revision: 00346606c36617d7d4cc21d33207e44abef8137a
Build date: 2014-06-18 00:30:54-04
Xamarin addins: 4072f200bfd429706bec44bfa9ebf698f9439b67
Comment 2 Alicia Tams 2014-06-20 12:15:28 UTC
I don't need to fix anything. What I'm doing is working right now. Xamarin studio highlights that line and tells me tint color is not available outside of iOS 7 when it's actualkly available in iOS 5. BarTintColor is the one only available in iOS 7. I'm just very particular about not seeing errors in my code even if they are hints and / or warnings.
Comment 3 Ram Chandra 2014-06-20 14:13:34 UTC
I have checked this  issue and with the help of "Comment 2" I am able to reproduce this issue.

I observed that "TintColor" property is available on iOS 5 but when we hover over the "TintColor" property it shows a hint message i.e. "Hint: This API is only available on iOS 7.0 or later."

Screencast: http://www.screencast.com/t/EV7HKttk5

Environment Info:

Mac OS X 10.9.3

Xamarin Studio: 5.0.1 (build 3)

=== Build Information ===
Release ID: 500010003
Git revision: f94ee866936d25105704eb63728ad5a981eda0a4
Build date: 2014-06-04 12:19:12-04
Xamarin addins: 1a6044e8321ea07e03a56b5381951686c82fed8b
Comment 4 Mike Krüger 2014-06-21 02:57:01 UTC
Not a Xamarin Studio Issue - moving to ios libraries.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2014-06-23 03:46:49 UTC
According to Apple 'tintColor' is available starting with iOS 7 [1]

However I remember vaguely from a session in last year's WWDC that there were API that were made public in iOS 7, but that you could still use from older versions of iOS because they were introduced earlier (but they were private API until iOS 7). I can't find a reference to this now, but I believe this is what happened with 'tintColor'.

So I've fixed it, TintColor is now marked as introduced in iOS 5 on our side.

monotouch/master: 52009d77df9fade1935f8c536bbc02e46b8cecec

[1] https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/instp/UIView/tintColor
Comment 6 Sebastien Pouliot 2014-07-03 20:09:14 UTC
@Rolf, was the change tested on a 5.0 device ?

`tintColor` and `setTintColor:` both fails (to respond to the selector*) on UIView when executed on my iPad running 5.1.1 and this also looks like the source of error for Gouri (on a 6.0.1 device).

* it could be working without responding the the selector, I'll try that before reverting.
Comment 7 Sebastien Pouliot 2014-07-03 20:19:54 UTC
This code

			using (var v = new UIView ()) {
				var tc = v.TintColor;
				Assert.NotNull (tc, "TintColor-1");
				v.TintColor = UIColor.Red;
				v.TintColor = null;
				// setting to null returns to default (i.e. not the last non-null value)
				Assert.NotNull (v.TintColor, "TintColor-2");

crash when executed on 5.1.1 with the following message:

2014-07-03 20:13:16.854 monotouchtest[10711:707] -[UIView tintColor]: unrecognized selector sent to instance 0x131b9c10

Reverted in master / ed2abc3279babcbf00fad1065d14cddfc2fc0114
Comment 8 Sebastien Pouliot 2014-07-03 20:20:17 UTC
The original description said:

> Appearance.TintColor on bars

so I think the attribute might have been applied to the wrong type (UIView).

@Alicia did you mean UINavigationBar ?
Comment 9 Sebastien Pouliot 2014-07-03 20:49:14 UTC
Somehow I missed the title, UINavigationBar, and since it subclass UIView that explains why Rolf added the attribute on UIView. 

However `tintColor` implementation moved down to UIView (in iOS7) and that's not compatible with iOS5 (or 6). 

Not sure, beside documentation, how we can expose this without creating issues. Overriding UINavigationBar is an option that would allow adding the attribute, but also means more code (for not other reason).

Keeping open at lower priority.
Comment 10 Rolf Bjarne Kvinge [MSFT] 2014-07-04 01:49:56 UTC
I did test it, but I can't remember the code I used. I probably tested UINavigationBar.Appearance.TintColor instead of UIView.TintColor, which would explain why I didn't see the problem.