uiappearance

UIApperance and various crashes

自闭症网瘾萝莉.ら 提交于 2019-12-09 01:21:41
问题 I'm getting so frustrated while customizing my app. I've already created and styled almost the whole app, including Navigation bar, toolbar, tabBar etc, but everytime a MFMailComposeViewController, a MFMessageComposerViewController, Twitter or Facebook sharers or even a QuickLook View Controller comes in play, the app crashes with the message: *** Assertion failure in -[UICGColor encodeWithCoder:]. *** Terminating app due to uncaught exception 'NSInternalInconsistencyExceptionì, reason: 'Only

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

坚强是说给别人听的谎言 提交于 2019-12-08 14:58:26
问题 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 UIButton. I've tried putting the code to remove it's background inside - (void)viewDidLoad but it's not working - UIAppearance rules aren't applied yet. In one ViewController I put modification code inside - (void)viewWillLayoutSubviews and it worked

Xamarin.iOS UIApperance setDefaultTextAttributes

偶尔善良 提交于 2019-12-08 03:36:58
问题 I'm trying to figure out how to implement following code in Xamarin: [[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setDefaultTextAttributes:@{NSForegroundColorAttributeName:[UIColor greenColor]}]; But I cannot find a way to setDefaultTextAttributes on UIApperance class. 回答1: There are a number of missing UIAppearance features in Xamarin.iOS and in regards to your question, there is a missing API. This is a bug, 🍣 I wrote my own UIAppearance.cs to add the missing features

set appearance proxy for view controller root view

耗尽温柔 提交于 2019-12-07 22:46:35
问题 is it possible to target only a view controller's root view when using UIAppearance? I would like to setBackgroundColor for all of my controllers from my app delegate, but want to target only the direct view on a view controller. Thanks. To elaborate, each UIViewController subclass has its own UIView object you can call via its view property. That's the view you put any stuff on like UITableView, UITabBar, etc in storyboard. I want the proxy to only apply to that direct view, since everything

UINavigationBar title behaves oddly when specifying a font using UIAppearance (with iOS 5 only)

删除回忆录丶 提交于 2019-12-07 18:53:31
问题 I am using UIAppearance to set the font for my UINavigation bar title across my app. If I don't set an appearance font, the title is there immediately, as expected, and its presentation is not animated. However, when I specify an alternative font using UIAppearance, the title appears (with the specified font) but appears using some sort of animated transition on loading on iOS 5. It also sometimes stalls (?) and only displays the first character of the title. If I tab away and back again, the

use UIAppearance methods for customizing UIAlertView

混江龙づ霸主 提交于 2019-12-07 13:23:45
问题 I know that UIAlertView conforms to UIAppearance and UIAppearanceContainer . But how do I use UIAppearance to customize/style UIAlertView ? I am not able to find it over the net. 回答1: You can't use UIAppearance to customise UIAlertView . UIAlertView only shows as having UIAppearance because UIView conforms to UIAppearance and UIAlertView is a subclass of UIView . It doesn't actually implement it though. 回答2: If you want to use UIAlertView functionality, modally view, etc... you can subclass

iOS – UIAppearance appearanceWhenContainedIn issues

主宰稳场 提交于 2019-12-07 00:12:26
问题 I'm setting an image for my navigationbar like so: [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar.png"] forBarMetrics:UIBarMetricsDefault]; Then I don't want this image for classes of MFMessageComposeViewController so I exclude it by doing this: [[UINavigationBar appearanceWhenContainedIn:[MFMessageComposeViewController class], nil] setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; But it has no effect (the navbar is still styled with my image inside

Text color in UIMenuController affected by UIButton appearance setting

99封情书 提交于 2019-12-06 22:32:27
问题 I've observed following: By setting the Titlecolor of a UIButton with appearance, the UIMenuItems in a UIMenuController of a UITextView are getting the same color. Code in applicationDidFinishLaunching : [[UIButton appearance] setTitleColor:[UIColor greenColor] forState:UIControlStateNormal]; My question: Is there a way to suppress it or give a UIMenuItems another color? What i have tried: With appearanceWhenContainedIn UITextview I've tried to set the appearance for buttons contained in

setBackgroundImage for UIBarButtonItem via appearance not working for other UIControlStates

可紊 提交于 2019-12-06 14:36:51
I'm trying to customize a UIBarButtonItem using the appearance method (>iOS 5.0). It works fine for the UIControlStateNormal, but not for highlighted or disabled. See images Here's the code I use to set those: // now configure the UIBarButtonItems UIImage *buttonBGInactive = [[UIImage imageNamed:@"button-navbar-30-inactive.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)]; UIImage *buttonBGActive = [[UIImage imageNamed:@"button-navbar-30-pressed.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)]; [[UIBarButtonItem appearanceWhenContainedIn:

UINavigationBar title behaves oddly when specifying a font using UIAppearance (with iOS 5 only)

谁说胖子不能爱 提交于 2019-12-06 08:37:45
I am using UIAppearance to set the font for my UINavigation bar title across my app. If I don't set an appearance font, the title is there immediately, as expected, and its presentation is not animated. However, when I specify an alternative font using UIAppearance, the title appears (with the specified font) but appears using some sort of animated transition on loading on iOS 5. It also sometimes stalls (?) and only displays the first character of the title. If I tab away and back again, the title is displayed correctly. I see this problem on iOS 5 only, and setting the title with a font