uiappearance

Xamarin.iOS UIApperance setDefaultTextAttributes

孤者浪人 提交于 2019-12-06 05:37:10
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. 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 and correct the missing API and assume no other Xamarin.iOS coders really use the newer UIAppearance features

set appearance proxy for view controller root view

主宰稳场 提交于 2019-12-06 04:30: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 in UIKit is pretty much a subclass of UIView. The purpose for this is is to centralize control on my

use UIAppearance methods for customizing UIAlertView

╄→尐↘猪︶ㄣ 提交于 2019-12-05 19:47:35
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. 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. If you want to use UIAlertView functionality, modally view, etc... you can subclass it. Here an example: http://www.albertopasca.it/whiletrue/2012/07/objective-c-modal-view-navigation-tabbar

iOS5 UINavigationBar background image issues when prompt is shown

断了今生、忘了曾经 提交于 2019-12-05 18:42:50
I am using the new appearance proxy in iOS 5 to style my UINavigationBar with a background image. [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationBG.png"] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationLandscapeBG.png"] forBarMetrics:UIBarMetricsLandscapePhone]; This works fine, but I need to set the prompt property of the nav bar. When I do that, the height of the nav bar increases, and my background image no longer fills that nav bar vertically, so it looks very bad. How can I account

UIPageControl + UIAppearance

☆樱花仙子☆ 提交于 2019-12-05 17:20:07
The docs for UIAppearance is extremely poor. I want to customize the colours for a UIPageController, but I am unable to figure out which properties to set. When I go [UIPagecontrol appearance] set I get probably hundreds of options, so it's nearly impossible to figure out what's what. I would assume it's possible with UIAppearance proxy, right? Thank you UIAppearance protocol was added to UIPageControl as of iOS 6. The properties you can customise are: Dot tint colour Highlighted dot tint colour This is an excerpt from UIPageControl.h , as you can see these UIAppearance additions are only

MFMessageComposeViewController appearance iOS 7

扶醉桌前 提交于 2019-12-05 02:36:43
I have an appearance proxy that sets the barTintColor property to green on UINavigationBar [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:54./255 green:165./255 blue:53./255 alpha:1]]; As needed I override this using appearanceWhenContainedIn: [[UINavigationBar appearanceWhenContainedIn:[INFSearchViewController class], nil] setBarTintColor:[UIColor colorWithWhite:0.80 alpha:1]]; This works fine. However when I present an MFMessageComposeViewController it adheres to the UINavigationBar proxy and looks like the following. Which obviously looks terrible, I would prefer

Text color in UIMenuController affected by UIButton appearance setting

拜拜、爱过 提交于 2019-12-05 02:24:46
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 TextViews with [UIButton appearanceWhenContainedIn:[UITextView class], nil] But this obviously didn't work

Weird behavior with UISegmentedControl and UIAppearance

感情迁移 提交于 2019-12-04 12:35:31
问题 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

Misaligned title in UINavigationBar since iOS6

独自空忆成欢 提交于 2019-12-04 01:38:21
问题 Ever since iOS 6 I have several problems with using custom styling in my application. I use a custom font and several UIAppearance proxies. A problem I can't get my head around is the misalignment of the title in my UINavigationBar. In iOS 5 everything worked fine and was correctly aligned. Since iOS6 has been released and custom styling is not uncommon I assume this isn't a bug but my misunderstanding of some new change to iOS6. I've searched the documentation for a text alignment method to

Can I detect iOS' “darken colors” setting?

早过忘川 提交于 2019-12-03 22:59:19
问题 I noticed that my app doesn't look good when the "darken colors" iOS system setting is enabled. Some navigation buttons are white, some are darkened to gray. Is there any way to detect if this setting is enabled? 回答1: Turns out it's quite easy to detect. Suppose the navigationBar is configured with a white tintColor . Just reading navigationBar.tintColor returns the adjusted color, in this case 80% white. We can use this color to set the navigationBar.titleTextAttributes . For all tintable