uiappearance

Separating UIAppearence code

爱⌒轻易说出口 提交于 2019-12-13 06:21:36
问题 I want to implement add themes to an app I'm creating. Simply just switching between 2 colors and I want the navigation bars, tool bars etc. to appear in the selected color. When the app first loads, I apply one color to in the didFinishLaunchingWithOptions method in the AppDelegate. UIColor *blueTheme = [UIColor colorWithRed:80/255.0f green:192/255.0f blue:224/255.0f alpha:1.0f]; UIColor *pinkTheme = [UIColor colorWithRed:225/255.0f green:87/255.0f blue:150/255.0f alpha:1.0f]; [

Xamarin.iOS - Action Sheet Line Numbers

人走茶凉 提交于 2019-12-13 03:15:30
问题 I have this scenario: My action sheets have a variant text size, like in this question, but trying to access this API from xamarin iOS, I cant find the property: UILabel.appearance(whenContainedInInstancesOf: [UIAlertController.self]).numberOfLines = 2 Reading this question, anwsered by @SushiHangover, there are many hidden API's by Xamarin, and with the code, I think I can achieve the desired behavior. So, in Xamarin.iOS, how can I force my action sheet's options to have two or more lines of

trouble with UIAppearance and UIButton subclassing

送分小仙女□ 提交于 2019-12-12 02:34:51
问题 I have a custom button, that is just a standard UIButton, but with a CAGradientLayer added in. In my custom button, I have defined two properties: @property (nonatomic, strong) UIColor* topColor UI_APPEARANCE_SELECTOR; @property (nonatomic, strong) UIColor* bottomColor UI_APPEARANCE_SELECTOR; If those two values get set, the my button draws itself with a nice linear gradient. Works great. I also like to put as much into InterfaceBuilder as possible. So, on some of these buttons, in IB's

appearance proxy not working as intended for UIButton font

馋奶兔 提交于 2019-12-11 14:06:23
问题 im currently styling my app via the appearance proxy and i ran into this problem: when i set properties on the UIButton appearance my font is ignored: [buttonAppearance setTitleColor:darkColor forState:UIControlStateNormal]; [buttonAppearance.titleLabel setFont:[UIFont fontWithName:@"Helvetica Neue" size:10.0]]; the first line is applied properly (darkColor is some UIColor), but my font change is ignored completely. When i copy the line into my ViewController and apply it to a concrete button

UIBarButtonItem setBackgroundImage not working anymore in iOS7 iPad

孤者浪人 提交于 2019-12-11 12:38:41
问题 I have this appearance related code that was working fine in iOS 5: -(void)customizeBackButton:(UIBarButtonItem*)backButtonItem {; [backButtonItem setBackgroundImage:[UIImage imageNamed:@"backbuttonitem"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; } This method is called within viewDidLoad in normal UIViewController . Backbutton is a connected IBOutlet of a UIBarButtonItem, placed in a UIToolbar, and I am correctly seeing it when debugging. The point is that I can change

UINavigationBar appearance and Facebook-Sheet Bug

心已入冬 提交于 2019-12-11 08:12:16
问题 I use the following code in my appdelegate: UINavigationBar *navigationBar = [UINavigationBar appearance]; [navigationBar setBackgroundImage:[[UIImage imageNamed:@"top_bar"] stretchableImageWithLeftCapWidth:5 topCapHeight:5] forBarMetrics:UIBarMetricsDefault]; [navigationBar setBackgroundImage:[[UIImage imageNamed:@"top_bar_scape"] stretchableImageWithLeftCapWidth:5 topCapHeight:5] forBarMetrics:UIBarMetricsLandscapePhone]; Everything works fine but i got a weird Bug, when i open the iOS6

How to create a UIAppearance proxy for an inherited view in MonoTouch?

浪尽此生 提交于 2019-12-11 02:58:41
问题 I created a subclass of UIButton which acts as a custom Back button inside UIBarButtonItem : - - - - - - - - - - - - - - - - - | UIBarButtonItem | | ------------------------ | / | | \ BackButton : UIButton | | ------------------------ | _ _ _ _ _ _ _ _ _ _ _| As I was switching my code to using UIAppearance , I noticed that BackButton.Appearance is, unsuprisingly, inherited from UIButton.Appearance , and therefore changing it will change all UIButton s throughout the application and not just

Can you use UIAppearance to set the titleview of UINavigationItem?

时光怂恿深爱的人放手 提交于 2019-12-10 12:39:39
问题 I currently use this code to set the titleView of my navigation item: - (void)viewDidLoad { ... UIImage *navbarTitle = [UIImage imageNamed:@"navbartitleview1"]; UIImageView *imageView = [[UIImageView alloc]initWithImage:navbarTitle]; self.navigationItem.titleView =imageView; } Is there a way I could put this code using UIAppearance? [UINavigationItem appearance] is not valid. 回答1: No you wan't be able to do that with UIAppearence , what you can is to have a UIViewController from where all the

UIPageControl + UIAppearance

巧了我就是萌 提交于 2019-12-10 09:34:39
问题 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 回答1: UIAppearance protocol was added to UIPageControl as of iOS 6. The properties you can customise are: Dot tint colour Highlighted dot

iOS 5 Back Button Size

耗尽温柔 提交于 2019-12-09 13:50:07
问题 I'm using the iOS 5 UIAppearance protocol to use a custom navigation bar back button as seen here. Unlike other methods I've found, this one is the best since it preserves the default back button animations and behaviours. The only problem is that I can't change its size or set it to not clip subviews . Here's what's happening: A is intended behaviour, B is default style, C is the clipped result. Unfortunately, it's not as easy as setting UIBarButtonItem to clipsToBounds=NO. Does anyone know