Questions tagged [uiappearance]

iOS 5+ API for appearance customisation. You use the UIAppearance protocol to get the appearance proxy for a class. You customize the appearance of instances of a class by sending appearance modification messages to the class’s appearance proxy.

UIAppearance allows the appearance of views and controls to be consistently defined across the entire application.

UIAppearance is a protocol that returns a proxy that will forward any configuration to instances of a particular class.

API introduced in iOS 5 allowing convenient customisation of appearance properties for all instances of class by sending appearance specification messages to the class' appearance proxy..

Note: iOS applies appearance changes when a view enters a window, it doesn’t change the appearance of a view that’s already in a window. To change the appearance of a view that’s currently in a window, remove the view from the view hierarchy and then put it back.

448 questions
18
votes
5 answers

UIAppearance not taking effect on UILabels created programmatically

We have extended UILabel to be able to apply standard fonts and colors for all uses of a given label type in our apps. Eg. @interface UILabelHeadingBold : UILabel @end In our AppDelegate, we apply fonts and colors like this [[UILabelHeadingBold…
ckibsen
  • 943
  • 1
  • 7
  • 9
17
votes
1 answer

UIAppearance Swift 4

After updating to Swift 4, I am getting a compiler error: Static member 'appearance' cannot be used on protocol metatype 'UIAppearance.Protocol' Here is my viewWillAppear method in my custom Tab Bar Controller subclass, I am setting the font of the…
Eli Whittle
  • 1,084
  • 1
  • 15
  • 19
17
votes
3 answers

UILabel appearance font and attributed string font

In my app I have a global custom font applied to all labels like so: UIFont *font = [UIFont fontWithName:kMyFontName size:15.0]; [[UILabel appearance] setFont:font]; This works fine. However, in some cases I want to be able to specify a different…
nebs
  • 4,939
  • 9
  • 41
  • 70
17
votes
4 answers

UIAppearance proxy for custom objects

I have a custom object, it inherits from NSObject. This object does "some things", one of it is creating an UIView with some UIKit objects (UILabel, UIButtons ecc ecc...). This object has some properties like: textColor, font, backgroundColor...…
LombaX
  • 17,265
  • 5
  • 52
  • 77
17
votes
3 answers

Override UIAppearance property for MFMailComposeViewController

I am using the UIAppearance protocol to set the background image of UINavigationBar objects throughout my app. [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"image-name"] forBarMetrics:UIBarMetricsDefault]; I would like to…
markdorison
  • 139,374
  • 27
  • 55
  • 71
16
votes
2 answers

Customizing UIBarButtonItem "Done" style and "Plain" style separately using UIAppearance

I know how to customize UIBarButtonItem using -setBackgroundImage: forState: barMetrics:, but I would like to use different images for UIBarButtonItemStyleDone and UIBarButtonItemStylePlain. Is there a way to accomplish this using the UIAppearance…
James
  • 762
  • 8
  • 22
15
votes
2 answers

iOS 7 UINavigationBar appearance not working first time…

I am trying to change the look of the UINavigationBar in my iOS7 app. I am doing the following: - (void)viewDidLoad { [super viewDidLoad]; m_sNumberToCall = @""; UIBarButtonItem * btn = [[UIBarButtonItem alloc] initWithImage:[UIImage…
LilMoke
  • 3,176
  • 7
  • 48
  • 88
15
votes
4 answers

UIAppearance setTranslucent error: Illegal property type, c for appearance setter, _installAppearanceSwizzleForSetter

Trying out iOS 7 did: [[UINavigationBar appearance] setTranslucent:NO]; Got crash and error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** Illegal property type, c for appearance setter,…
shim
  • 9,289
  • 12
  • 69
  • 108
14
votes
1 answer

UITextView KeyboardAppearance property to set UIKeyboardAppearanceDark

I simply want the keyboard of UITextView to appear in dark mode. However UItextView doesn't have such a property. Normally for UITextField you can use the following to change the keyboards across the app: [[UITextField appearance]…
Ömer Faruk Gül
  • 965
  • 1
  • 10
  • 22
14
votes
2 answers

When do UIAppearance proxy rules get applied to new view controller?

I'm wandering when exactly do UIAppearance rules get applied to some new view controller? I've made some global rules and I call them in my app delegate. That way all UIButtons look that same. But now I want to modify just appearance of one…
xx77aBs
  • 4,678
  • 9
  • 53
  • 77
13
votes
3 answers

Uppercase string for all UINavigation bar titles

Currently, I am changing the font of the navigation bar using the following in the AppDelegate: [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIFont fontWithName:@"..." size:...],…
p0lAris
  • 4,750
  • 8
  • 45
  • 80
13
votes
3 answers

UIAppearance's "when not contained in"

I am currently spinning a complex web of UIAppearance modifiers*, and have come across a problem. My usage of FlatUIKit's custom UIBarButton appearance protocol is causing MFMailComposerViewController to complain and stop working. Therefore, instead…
Sarreph
  • 1,986
  • 2
  • 19
  • 41
13
votes
8 answers

Custom iOS UIDatepicker using UIAppearance

UNIQLO's new alarm app has a custom UIDatePicker: And I want to create my own custom UIDatePicker. I tried to change the appearance of the DatePicker, but looking for UI_APPEARANCE_SELECTOR in the UIDatePicker returns nothing. Meaning that its not…
daihovey
  • 3,485
  • 13
  • 66
  • 110
13
votes
2 answers

UIImage resizableImageWithCapInsets: not working as expected

I'm writing my first iOS app targeting the iOS 5.0+ platform. I'm using the UIAppearance protocol to customize the applications UI. I'm trying to change the backgrounds for UIBarButtonItem across the entire application. Due to the fact that my…
Brandon Cordell
  • 1,308
  • 1
  • 9
  • 24
11
votes
2 answers

iOS: Default status bar style with UIViewControllerBasedStatusBarAppearance YES

Is there a way how to set the default status bar style while keeping the UIViewControllerBasedStatusBarAppearance enabled? Here is the problem, I'm dealing with: Nearly the whole app needs to be using UIStatusBarStyle.LightContent as the navigation…
Tom Kraina
  • 3,569
  • 1
  • 38
  • 58
1
2
3
29 30