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
125
votes
11 answers

appearanceWhenContainedIn in Swift

I'm trying to convert my app to the Swift language. I have this line of code: [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes:textDictionary …
AlexZd
  • 2,152
  • 2
  • 18
  • 29
90
votes
7 answers

How to set font & color of the title in UINavigationBar using iOS5 appearance API?

I have a multiple View Controllers and I want to set the font color of all to red. [[UINavigationBar appearance] setFont:[UIFont boldSystemFontOfSize:12.0]]; is throwing an unrecognized selector error. How can I fix this?
carbonr
  • 6,049
  • 5
  • 46
  • 73
50
votes
4 answers

Appearance proxies / UI_APPEARANCE_SELECTOR in Swift?

The Apple documentation states: To participate in the appearance proxy API, tag your appearance property selectors in your header with UI_APPEARANCE_SELECTOR. In Objective-C one can annotate properties with UI_APPEARANCE_SELECTOR like…
Klaas
  • 22,394
  • 11
  • 96
  • 107
36
votes
5 answers

Customize text color of UIDatePicker for iOS7 (just like Mailbox does)

I'm having the most frustrating dilemma. I've researched up and down and can clearly see that Apple does not want us tampering with iOS 7. Well, I want to tamper. And, the team at Mailbox clearly figured out how to do it and get approved. The main…
rnystrom
  • 1,906
  • 2
  • 21
  • 47
30
votes
7 answers

titleTextAttributes UIAppearance font in iOS 7

I am using UIAppearance to apply fonts to UINavigationBar and UIBarButtonItem and I am having problems. I ran this code: [[UIBarButtonItem appearanceWhenContainedIn:[UIToolbar class], nil] setTitleTextAttributes: @{NSFontAttributeName : [UIFont…
LOP_Luke
  • 3,150
  • 3
  • 22
  • 25
30
votes
4 answers

How do I apply UIAppearance Proxy properties to UILabel?

I have been getting unreliable results while trying to apply UIAppearance proxy styles to the UILabel class proxy. For example, the following works as I would expect: [[UILabel appearance] setFont:[UIFont fontWithName:SOME_FONT…
Joshua J. McKinnon
  • 1,696
  • 1
  • 18
  • 29
26
votes
3 answers

Customizing Left & Right UISegmentedControl Buttons

I'm trying to customize the following segmented control, using a left image for the first button and a right image for the second button. How would I do this using UIAppearance? I want to change the following segmentedControl: to something similar…
Year3000
  • 459
  • 2
  • 7
  • 15
25
votes
3 answers

How to change color of UISegmentedControl border in iOS7?

How do I change the border color of the segmented controller in iOS7 without changing the text color? It would be ideal if I could keep the line between the segments as is (i.e. same color as the text), but if a border color change implies a…
OscarWyck
  • 2,515
  • 5
  • 21
  • 26
24
votes
2 answers

Custom Container Controller: transitionFromViewController: View not properly layed-out before animation

This is both a question and a partial solution. *Sample project here: https://github.com/JosephLin/TransitionTest Problem 1: When using transitionFromViewController:..., layouts done by the toViewController's viewWillAppear: doesn't show up when…
Joseph Lin
  • 3,324
  • 1
  • 29
  • 39
20
votes
1 answer

respondsToSelector fails for appearance proxy

I’m trying to detect an iOS 6-specific appearance method, by running respondsToSelector on the [UIBarButtonItem appearance]. However, it always returns NO for me, whatever selector I specify: // Should show NOPE in iOS 5, YEP in iOS 6. Shows NOPE…
Arnold
  • 2,390
  • 1
  • 26
  • 45
19
votes
6 answers

Change navigation button color in MFMailComposerViewController on iOS 7

I'm trying to change the text color for navigation buttons in a MFMailComposerViewController but it doesn't work like on iOS 6. In iOS 6 it worked with UIAppearance like this: // Navigation button UIBarButtonItem *barButton = [UIBarButtonItem…
OemerA
  • 2,662
  • 7
  • 28
  • 31
19
votes
6 answers

How to set UITabBarItem's unselected tint, ***including system items*** (iOS7)

(NOTE: I see there are several similar questions on SO, but none of them seem to get at my specific issue of wanting to change the unselected appearance of both custom and system UITabBarItems.) I'm working in iOS7. I have a UITabBar with some…
Olie
  • 24,597
  • 18
  • 99
  • 131
19
votes
4 answers

Setting navigation bar back button image

I want to set the back button in my UINavigationBar to this image: I don't want the image to be embedded in the standard back button image, I just want this image to appear. I know from looking at other questions that I can use: [[UIBarButtonItem…
Darren
  • 10,091
  • 18
  • 65
  • 108
18
votes
3 answers

UISwitch setThumbTintColor causing crash (iOS 6 only)?

UPDATE: Got a mail from Apple saying that the bug/issue has been fixed now and the next SDK release won't have this issue. Peace! I have this in the code for my AppDelegate: - (void) customizeAppearance { [[UISwitch appearance]…
Bourne
  • 10,094
  • 5
  • 24
  • 51
18
votes
1 answer

iOS 6 appearance when contained in multiple classes

I’m using the appearanceWhenContainedIn method on certain UI elements that I want to customise in my iOS 6 app. The problem I found is that none of my customisations are applied if I try to provide more than one container class, like so: // Works…
Arnold
  • 2,390
  • 1
  • 26
  • 45
1
2 3
29 30