uibarbuttonitemstyle

UIBarButtonItemStyleDone does not create blue buttons in navigation bar when controller is pushed

我们两清 提交于 2019-12-23 08:51:20
问题 I've searched around on several different forums and can't seem to find an answer for this. I have added a bar button item to a navigation controller and set its style to UIBarButtonItemStyleDone. When this is the first controller on the navigation stack, the button properly shows up blue. However, when the controller is created and pushed onto the stack, the style is ignored and it shows up black. I know that this problem occurs when the tintColor has been changed, but I am using the

“Plain Style unsupported in a Navigation Item” warning with my customized Bar Button Item

孤者浪人 提交于 2019-12-18 10:44:16
问题 I drag a Round Rect Button to the position of the right Bar Button Item, and set an image to the Round Rect Button. All works well, except the warning "Plain Style unsupported in a Navigation Item". Even if i select the style of the Bar Button Item to "Bordered", warning still be there. What's the matter with Xcode 4.2? Thanks in advance! Ps. I customized many Bar Button Items with Round Rect Button, some times Xcode 4.2 shows only one warning on a Bar Button Item, some times shows warnings

Use UIBarButtonItem icon in UIButton

亡梦爱人 提交于 2019-12-17 15:47:20
问题 UIBarButtonItem has multiple icons available. Is it possible to use the icon which appears after setting its identifier to 'trash': with an UIButton ? There is no straighforward method to do that like setting the identifier or style . 回答1: Download the image from somewhere on the web, add it to your project and set the UIButton 's image to the image you just downloaded. I did not find the same as Apple is using but I found this one. Simply change it's color in Pixelmator or Photoshop. 回答2:

how can I set the tint color of right UIBarButtonItem in Swift?

淺唱寂寞╮ 提交于 2019-12-12 01:46:13
问题 I'm adding a right bar button to my navigation controller with the following code in viewDidLoad : var b = UIBarButtonItem( image: UIImage(named: "settings"), style: .plain, target: self, action: #selector(sayHello(sender:)) ) self.navigationItem.rightBarButtonItem = b my settings png file is white, but when I run the app, I see it in default blue color. Anyway, I want to change it to red. How can I do it? I tried this: let navigationBarAppearnce = UINavigationBar.appearance()

Explain this margin logic for leftBarButtonItem, rightBarButtonItem, titleView

你说的曾经没有我的故事 提交于 2019-12-07 06:05:39
问题 Can anyone explain to me where the margins you see in this screen shot below are coming from? I want the red, green and blue rectangles to all fit next to each other in both screen layouts, landscape and portrait. Instead I see inexplicable margins between the views. // Setup Left Bar Button item UIBlankToolbar* tools = [[[UIBlankToolbar alloc] initWithFrame:CGRectMake(0, 0, 115, 44)] autorelease]; tools.autoresizingMask = UIViewAutoresizingFlexibleWidth; [tools setBackgroundColor:[UIColor

Explain this margin logic for leftBarButtonItem, rightBarButtonItem, titleView

倾然丶 夕夏残阳落幕 提交于 2019-12-05 10:20:16
Can anyone explain to me where the margins you see in this screen shot below are coming from? I want the red, green and blue rectangles to all fit next to each other in both screen layouts, landscape and portrait. Instead I see inexplicable margins between the views. // Setup Left Bar Button item UIBlankToolbar* tools = [[[UIBlankToolbar alloc] initWithFrame:CGRectMake(0, 0, 115, 44)] autorelease]; tools.autoresizingMask = UIViewAutoresizingFlexibleWidth; [tools setBackgroundColor:[UIColor greenColor]]; self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:tools]

UIBarButtonItemStyleDone background image using the iOS 5 appearance API

本小妞迷上赌 提交于 2019-12-04 22:50:56
问题 How can I provide a visually distinct bar button item background image for bar buttons with the UIBarButtonItemStyleDone style and the editing state of the Edit/Done button? None of the documented UIControlState values in the UIBarButtonItem appearance proxy's setBackgroundImage:forState:barMetrics: seem to do the trick. 回答1: I'm not sure why this was never answered but if you are still looking then simply create a property for a BarButtonItem in your .h, assign it in IB, then set the

UIBarButtonItemStyleDone background image using the iOS 5 appearance API

一曲冷凌霜 提交于 2019-12-03 14:44:17
How can I provide a visually distinct bar button item background image for bar buttons with the UIBarButtonItemStyleDone style and the editing state of the Edit/Done button? None of the documented UIControlState values in the UIBarButtonItem appearance proxy's setBackgroundImage:forState:barMetrics: seem to do the trick. I'm not sure why this was never answered but if you are still looking then simply create a property for a BarButtonItem in your .h, assign it in IB, then set the background property of that barButtonItem. Works fine for me and never "changes back to default appearance". -

“Plain Style unsupported in a Navigation Item” warning with my customized Bar Button Item

*爱你&永不变心* 提交于 2019-11-30 00:12:56
I drag a Round Rect Button to the position of the right Bar Button Item, and set an image to the Round Rect Button. All works well, except the warning "Plain Style unsupported in a Navigation Item". Even if i select the style of the Bar Button Item to "Bordered", warning still be there. What's the matter with Xcode 4.2? Thanks in advance! Ps. I customized many Bar Button Items with Round Rect Button, some times Xcode 4.2 shows only one warning on a Bar Button Item, some times shows warnings on all Bar Button Items. I was able to remove these errors by manually editing the storyboard files and

Use UIBarButtonItem icon in UIButton

微笑、不失礼 提交于 2019-11-27 20:02:48
UIBarButtonItem has multiple icons available. Is it possible to use the icon which appears after setting its identifier to 'trash': with an UIButton ? There is no straighforward method to do that like setting the identifier or style . Download the image from somewhere on the web, add it to your project and set the UIButton 's image to the image you just downloaded. I did not find the same as Apple is using but I found this one . Simply change it's color in Pixelmator or Photoshop. for swift 4.2 (call it on main thread) extension UIBarButtonItem.SystemItem { func image() -> UIImage? { let