Questions tagged [uibarbuttonitem]

UIBarButtonItem is a button specialized for placement on a UIToolbar or UINavigationBar object. It inherits basic button behavior from its abstract superclass, UIBarItem. The UIBarButtonItem defines additional initialisation methods and properties for use on toolbars and navigation bars. There are some methods for customizing Appearance. Available in iOS 2.0 and later in UIKit.

A bar button item is a button specialized for placement on a UIToolbar or UINavigationBar objects. It inherits basic button behavior from its abstract superclass, UIBarItem. The UIBarButtonItem defines additional initialization methods and properties for use on toolbars and navigation bars.

iOS includes a number of system-provided items with specific icons, but developers can create custom items as well.

Note: UIBarButtonItem is not a descendent of UIView, so many common tasks like applying animations or transforms can be more difficult than you might expect.

UIBarButtonItem Class Reference

2349 questions
0
votes
3 answers

Custom Back Indicator Image for Navigation Bar Swift

I am trying to set a custom image for the back bar button. I can remove the text, however, the default chevron arrow is still there. As illustrated below; I'm on x-code 11.3 My code is; let chevronImage = UIImage(systemName:…
David Henry
  • 1,972
  • 20
  • 43
0
votes
0 answers

Master-View-App in DetailView change title of Back Button

I try to change the title of the back button of the DetailView which was automatically generated by the MasterViewApp. Tried to change it with the following code: override func viewDidLoad() { super.viewDidLoad() // Do any…
Angie
  • 41
  • 1
  • 7
0
votes
0 answers

Is it possible to vertically position a custom UIBarButtonItem?

I have a custom UIBarButtonItem, consisting of a UIImage and a UILabel. Set up as such: addUsersButton = UIButton() barButtonView = UIView() addUsersImage = UIImageView(image: UIImage(named:…
Kevin2566
  • 425
  • 8
  • 20
0
votes
2 answers

Getting the UIBarButtonItems I have added using Interface Builder

I add 3 buttons to the leftBarButtonItem using interface builder. How do I get these buttons from the view Controller? I have tried that NSArray * buttons = self.navigationController.navigationBar.items[0].leftBarButtonItems; from viewDidAppear…
Duck
  • 34,902
  • 47
  • 248
  • 470
0
votes
1 answer

iPhone - Font used for Toolbar buttons

Could you tell me which font is used to display text on Toolbar buttons ? I'm searching this to make a custom button.
Oliver
  • 23,072
  • 33
  • 138
  • 230
0
votes
2 answers

How to change the font of all Toolbar Items in Navigation Header in Xamarin

I have created a custom navigation page in xamarin in order to change the font of the toolbar items in the navigation bar. All went well, however the font is not changing on all toolbar items, just the last one for some reason. As you can see, I…
0
votes
1 answer

Toolbar items reset to storyboard defaults when scrolling to top on iOS 13

I have two sets of toolbar items that should be shown, depending on whether editing is enabled. When the edit button is tapped, the toolbar (and navigation bar items as well) should change to the appropriate set of items. I do this by calling this…
CompC
  • 381
  • 2
  • 19
0
votes
1 answer

Why can't add more than 6 buttons to navigation bar as UIBarButton items (not as UIButton but UIBarButton items) in iOS13, swift

I'm trying to add UIBarButtonItems to navigation bar like below. It works fine. But last button item appears very small and it doesn't set sizes automatically. Here is how I add buttons and it worked fine before iOS 13. var…
Marlon Brando aka Ben
  • 863
  • 1
  • 14
  • 33
0
votes
0 answers

Is there a way to forward a touchevent from a UIBarButtonItem with a customView?

I'm trying to use a customView as rightBarButtonItem using the UIBarButtonItem(customView: UIView) initializer. My customView is basically a stackView with two objects: an imageView and a label. I added a tapgesturerecognizer to the whole view.…
0
votes
2 answers

How to set constraints on a button in a navigation bar? iOS 13 Swift 5 (Add circular profile image button to navigation controller)

I'm trying to implement a profile image button in the top left of my application. I'm having trouble getting it to look correct. It seems that no matter what constraints I put on the button it always comes out much larger and more lopsided than what…
Hunter
  • 51
  • 1
  • 7
0
votes
2 answers

UIBarButtonItem color setting in Swift-5.0

I realised that the color-behaviour of my UIBarButtonItem's (left and right buttons) is not as desired. If I press and hold the right UIBarButton (see video), then the color changes from light-yellow to gray'isch dark-yellow. However, I would like a…
iKK
  • 6,394
  • 10
  • 58
  • 131
0
votes
1 answer

Customised navigation bar back button title

I want customised navigation bar back button title with action. My Image : I need back button like this. Here i added text successfully, but not back arrow. Here my code has action for back button. This is my code //Custom barButtonItem with…
Naresh
  • 16,698
  • 6
  • 112
  • 113
0
votes
1 answer

How to remove title from UIBarButtonItem.appearance() on iOS 10.3

I want to personalize the Back Button of my app to have a consistent looking. So I'm setting a image as the Back Button of a Navigation Bar. The code bellow works fine on any iOS above iOS 10. So, I'm trying to make it work on iOS 10.3.1. This is…
0
votes
1 answer

How to horizontally center UIBarButtonItems in UINavigationBar

I want to center UIBarButtonItems in a UINavigationBar at the top of the screen. While still with UIBarButtonItems on the left and right sides. This is what I have tried already: (I am just using the .add icon for now to just make sure I have the…
0
votes
1 answer

UIBarButtonSystemItemTrash Image

Is it possible to retrieve the image that is displayed on the UIBarButtonItem when it's initialized with UIBarButtonSystemItemTrash?
fabian789
  • 8,348
  • 4
  • 45
  • 91
1 2 3
99
100