uibaritem

Get rid of the space on the right side of a UINavigationBar

假如想象 提交于 2019-12-30 09:57:13
问题 So, this is what I'm trying to accomplish: It's a UINavigationBar with a UIBarButtonItem that gets initialized with a custom UIButton . Basically like this: UIButton *favoriteButton = [UIButton buttonWithType:UIButtonTypeCustom]; [favoriteButton addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; favoriteButton.frame = CGRectMake(0.0f, 0.0f, 44.0f, 44.0f); UIImage *backgroundImage = [[UIImage imageNamed:@"favorite-button-background-orange"]

Navigation Bar not showing in Storyboard

帅比萌擦擦* 提交于 2019-12-11 12:09:17
问题 I embeded in a navigation controller to a viewController, and a nav bar item is showing (in the outline editor), and I can change the title, but the navigation bar is not showing in the (outline editor) and I therefore cannot change the bar tint color. So I tried adding in a nav bar programmatically, like this: .h file @property (strong, nonatomic) UINavigationBar *nav; .m file nav = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 50)]; self.nav.tintColor = [UIColor blueColor];

Why UIBarButtonItem not getting clicks in UIToolbar set as inputAccessoryView of UITextField?

六月ゝ 毕业季﹏ 提交于 2019-12-10 19:49:05
问题 UIBarItem does not respond to clicks inside UIToolbar which is setup as inputAccessoryView on a UITextField. The button does not show click animation when I try to click it, callback does not get called. My setup looks like: @interface MyViewController() @property (weak, nonatomic) IBOutlet UITextField *closeDateTextField; @property (strong, nonatomic) UIToolbar * datePickerToolbar; @end I setup toolbar with button: - (void)viewDidLoad { self.datePickerToolbar = [[UIToolbar alloc] init];

Get rid of the space on the right side of a UINavigationBar

喜欢而已 提交于 2019-12-01 06:39:38
So, this is what I'm trying to accomplish: It's a UINavigationBar with a UIBarButtonItem that gets initialized with a custom UIButton . Basically like this: UIButton *favoriteButton = [UIButton buttonWithType:UIButtonTypeCustom]; [favoriteButton addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; favoriteButton.frame = CGRectMake(0.0f, 0.0f, 44.0f, 44.0f); UIImage *backgroundImage = [[UIImage imageNamed:@"favorite-button-background-orange"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 2, 0, 0)]; [favoriteButton setBackgroundImage:backgroundImage forState

How do you use setTitleTextAttributes:forState in UIBarItem?

旧时模样 提交于 2019-11-28 03:28:31
How do you use setTitleTextAttributes:forState: in UIBarItem in iOS ? How do you set the NSDictionary ? Can't make it work and documentation isn't very clear about that. From the documentation: setTitleTextAttributes:forState: Sets the title’s text attributes for a given control state: - (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state Parameters: attributes: A dictionary containing key-value pairs for text attributes. You can specify the font, text color, text shadow color, and text shadow offset using the keys listed in NSString UIKit Additions Reference

How do you use setTitleTextAttributes:forState in UIBarItem?

坚强是说给别人听的谎言 提交于 2019-11-27 05:08:19
问题 How do you use setTitleTextAttributes:forState: in UIBarItem in iOS ? How do you set the NSDictionary ? Can't make it work and documentation isn't very clear about that. From the documentation: setTitleTextAttributes:forState: Sets the title’s text attributes for a given control state: - (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state Parameters: attributes: A dictionary containing key-value pairs for text attributes. You can specify the font, text color

How big should a UIBarButtonItem image be?

时间秒杀一切 提交于 2019-11-27 02:39:00
I'm looking to create my own custom Sort By Date and Sort By Number buttons that I plan on placing in the navigation bar as the right button. How big should my image be to appropriately fill the space -- the UIBarItem documentation page doesn't list anything about the size the image should be. As of iOS 11, the Human Interface Guidelines suggest glyphs be about 25×25 points in toolbars and navigation bars, up to a maximum of about 28 points. (And the HIG should definitely be in your bookmarks if you're working on iOS apps!) That would translate to images 25px square for older devices like iPad

How big should a UIBarButtonItem image be?

橙三吉。 提交于 2019-11-26 12:35:21
问题 I\'m looking to create my own custom Sort By Date and Sort By Number buttons that I plan on placing in the navigation bar as the right button. How big should my image be to appropriately fill the space -- the UIBarItem documentation page doesn\'t list anything about the size the image should be. 回答1: As of iOS 11, the Human Interface Guidelines suggest glyphs be about 25×25 points in toolbars and navigation bars, up to a maximum of about 28 points. (And the HIG should definitely be in your