uiappearance

UITextView KeyboardAppearance property to set UIKeyboardAppearanceDark

瘦欲@ 提交于 2019-12-03 11:48:55
问题 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] setKeyboardAppearance:UIKeyboardAppearanceDark]; However when I try the following, app crashes: [[UITextView appearance] setKeyboardAppearance:UIKeyboardAppearanceDark]; So, my question is simple, is there a way to change keyboard appearance when I use UITextView? I

Weird behavior with UISegmentedControl and UIAppearance

有些话、适合烂在心里 提交于 2019-12-03 08:58:47
I am setting the appearance of the segmented control via these statements in the app delegate. [[UISegmentedControl appearance] setBackgroundImage:[[UIImage imageNamed:@"segmentation_normal.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0 , 0, 0)] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [[UISegmentedControl appearance] setBackgroundImage:[[UIImage imageNamed:@"segmentation_selected.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0 , 0, 0)] forState:UIControlStateSelected barMetrics:UIBarMetricsDefault]; [[UISegmentedControl appearance] setDividerImage:

UIBarButtonItem appearance trouble in iOS 7, could this be an Apple bug?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 06:37:16
I saw an article a while back, which is here: User Interface Customization in iOS 6 It shows customization for iOS 6. Since the article I have written Apps that use the technique, it is pretty straightforward, no magic in there. However, I need to update one of my apps and under iOS 7 it does not work correctly. It appears that customization of UIBarButtonItems does not work the first time the view is presented. If I dismiss the view and then present it agin everything works fine. What is seen is shown here: First time view is presented: Second time: I have seen this issue in his example, my

UIAppearance not taking effect on UILabels created programmatically

北城以北 提交于 2019-12-03 05:05:22
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 appearance] setTextColor:<some color>]; [[UILabelHeadingBold appearance] setFont:<some font>]; When adding a UILabel in our XIB's, we can now select the class to be of type UILabelHeadingBold, and it works as expected. The label is shown with the correct font and color, as specified in our AppDelegate. However, if we create a label programmatically, eg.

iOS 6 appearance when contained in multiple classes

牧云@^-^@ 提交于 2019-12-02 22:38:46
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 neither for toolbar nor navbar items [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], [UIToolbar class], nil] // Works fine (but only for navbar items, obviously) [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] The official docs say that the parameter for this method can be a nil-terminated list of multiple

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

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 16:18:23
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 the transition animation begins. In other words, the pre-layout view shows during the animation, and it's contents snap to the post-layout positions after the animation. Problem 2: If I customize the background of my navbar's UIBarButtonItem , the bar button shows up with the wrong size/position before the animation, and snaps to the correct size

setSelectedImageTintColor not working in iOS 7

一世执手 提交于 2019-12-01 15:33:50
I'm trying to setSelectedImageTintColor in iOS 7, but it's not working. Here's the code that I have in my AppDelegate.m under didFinishLaunchingWithOptions UITabBarController *tabBarController = (UITabBarController *) self.window.rootViewController; UITabBar *tabBar = tabBarController.tabBar; for (UITabBarItem *item in tabBar.items) { UIImage *image = item.image; UIImage *correctImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; item.image = correctImage; } [[UITabBar appearance] setTintColor:[UIColor whiteColor]]; [[UITabBar appearance] setSelectedImageTintColor:

setSelectedImageTintColor not working in iOS 7

纵饮孤独 提交于 2019-12-01 14:33:21
问题 I'm trying to setSelectedImageTintColor in iOS 7, but it's not working. Here's the code that I have in my AppDelegate.m under didFinishLaunchingWithOptions UITabBarController *tabBarController = (UITabBarController *) self.window.rootViewController; UITabBar *tabBar = tabBarController.tabBar; for (UITabBarItem *item in tabBar.items) { UIImage *image = item.image; UIImage *correctImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; item.image = correctImage; } [[UITabBar

Customized back button appears on UIImagePickerController

馋奶兔 提交于 2019-12-01 06:23:44
I use the following code to customize the back button on the navigation bar throughout my application: UIImage *backButton = [[UIImage imageNamed:@"backButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; UIImage *backButtonOn = [[UIImage imageNamed:@"backButton_on"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonOn forState:UIControlStateHighlighted barMetrics

tvos: UITextView focus appearance like movies App

允我心安 提交于 2019-12-01 05:33:42
I am building a tvos app and i want the UITextView to behave similarly like in tvos Movies app. I am specially interested in the focused appearence. Please have a look ate these two pictures. Currently i am just adding background color to the textview when it is focused but how i can achieve this focused appearance in the attached images. here is my small code override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) { super.didUpdateFocusInContext(context, withAnimationCoordinator: coordinator) if context