Why the appearance settings are not working on my controls in monotouch 6? I'm setting a properties
UILabel.Appearance.Font = UIFont.FromName("Fontname", 16);
UILabel.Appearance.BackgroundColor = UIColor.Clear;
But when i'm creating a label
UILabel mLabel = new UILabel(new RectangleF(0, 0, width, height));
It looks like default label. With white background and dark text. And if i set a properties directly it works fine
mLabel.Font = UIFont.FromName("Fontname", 16);
mLabel.BackgroundColor = UIColor.Clear;
Gives me a correct result.
It seems like this problem is not specific to MonoTouch.
Quoting Joshua from another thread,
OK, it turns out that you cannot style any
UILabel
properties using theUIAppearance
proxy.While the
UILabel
class conforms to theUIAppearanceContainer
protocol, a check of UILabel.h shows that none of its properties are marked withUI_APPEARANCE_SELECTOR
, the prerequisite for the use ofUIAppearance
.
Which is annoying.