Bug 8342 - UIAppearance not applied to UILabel created in code
Summary: UIAppearance not applied to UILabel created in code
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-12 12:45 UTC by Mike Bluestein
Modified: 2017-09-27 17:16 UTC (History)
3 users (show)

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


Attachments
test case (5.24 KB, application/zip)
2012-11-12 12:45 UTC, Mike Bluestein
Details
Unified XI sample (4.78 KB, application/zip)
2017-09-27 17:16 UTC, Rolf Bjarne Kvinge [MSFT]
Details
Xcode sample (10.94 KB, application/zip)
2017-09-27 17:16 UTC, Rolf Bjarne Kvinge [MSFT]
Details


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 ANSWERED

Description Mike Bluestein 2012-11-12 12:45:18 UTC
Created attachment 2906 [details]
test case

Steps to reproduce the problem:

1. Set UILabel.Appearance properties
2. Create a UILabel and add it to the view hierarchy

Actual Results:

Appearance properties that were set have no effect.

Expected Results:

UILabel should appear on screen with with a visual appearance as per the properties set on UILabel.Appearance

I'm running version 6.0.6
Comment 1 Sebastien Pouliot 2014-02-25 17:43:13 UTC
I do not think it's an XI issue. Part of the issue is the lack of UI_APPEARANCE_SELECTOR on UILabel [1], i.e. TextColor is not decorated.

BackgroundColor really exist in UIView (not UILabel) but it was not decorated with UI_APPEARANCE_SELECTOR (before 7.0). Not sure why it still fails.

OTOH we know that UI_APPEARANCE_SELECTOR is not always required (and that's why we have some extra API on Appearance). Also it seems this works (at least for some people) when using NIB. Not sure why, maybe different code paths in iOS? There's much undocumented behaviour behind appearance :-(

[1] http://stackoverflow.com/q/11839044/220643
[2] http://stackoverflow.com/q/8316543/220643
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-09-27 17:15:10 UTC
I can reproduce the same behavior with an Xcode project, so this is not an XI issue.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2017-09-27 17:16:01 UTC
Created attachment 24962 [details]
Unified XI sample
Comment 4 Rolf Bjarne Kvinge [MSFT] 2017-09-27 17:16:21 UTC
Created attachment 24963 [details]
Xcode sample