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
1 answer

replacing UIBarButtonItem with custom view

Found this code to insert the "Done" Button within the decimal keyboard pad and it works as long I don't use a custom view for the button like in this piece of code: extension UITextField { func makeKeyboardToolBar(title: String) { let…
frameworker
  • 298
  • 1
  • 3
  • 16
0
votes
3 answers

Update UIBarButtonItem within view controller

I'm trying to update UIBarButtonItem tint color from a view controller but nothing has changed. Can't we access the UIBarButtonItem within view controller using self.navigationItem.rightBarButtonItem? [UIView animateWithDuration:.8 delay:0.5…
isuru
  • 3,385
  • 4
  • 27
  • 62
0
votes
4 answers

Is there an easy way to change the text color of a UIBarButtonItem without using an image?

Is there an easy way to change the text color of a UIBarButtonItem without using an UIImage as the background? By default the text is always white. I'd like to make it black.
skålfyfan
  • 4,931
  • 5
  • 41
  • 59
0
votes
1 answer

Going to the rootViewController of another navigationController programmatically?

I have an iPhone app with a UITabBar, and each tab has a unique navigationController. I'm adding a UIBarButton the navigationBar of each tab that will take the end user to the rootViewController of the first tab's navigationController. I'm trying to…
rottendevice
  • 2,849
  • 6
  • 30
  • 37
0
votes
1 answer

Custom Bar Button Item Image Frame Too Wide

I am trying to add a custom icon as the image of a bar button item. I correctly added the image assets in the 1x, 2x, 3x sizes, but the frame is too wide for no apparent reason. The image itself is a square and does not have such a wide frame. Click…
Rohit Chouhan
  • 57
  • 1
  • 5
0
votes
1 answer

UINavigationController title not aligned with UIBarButton

I have a title for my UINavigationBar, set by calling self.title = "self.title" in my custom UINavigationController and BarButtonItem is installed in the storyboard. Does anyone know what the cause of this misalignment might be and how I would go…
dinosaysrawr
  • 348
  • 2
  • 15
0
votes
1 answer

Correct placement of UIImageView in UIBarButtonItem

When attempting to place a UIImageView(UIImage) into a UIBarButtonItem on a UINavigationBar, the image gets placed in the middle of the bar and also has wide fields covering the entire bar. So, doesn't look like a small button on the left. I've…
my chalupa
  • 137
  • 11
0
votes
1 answer

Can't set UINavigationBar Title or place UIButtons in the UINavigationBar when back button is present

I am developing an application which will have multiple nested UIViewControllers. I have two views, one is the root view controller with a uibarbuttonitem, with is connected to another UIViewController. The UIViewController which was segued to does…
ItzAmmar
  • 53
  • 6
0
votes
2 answers

Unable to add barbuttonitem to navigation controller

I would like to integrate both navigation controller and tab bar controller in my project.But I am unable to add right barbutton to the navigation controller. I have attached the screenshot of the storyboard What I have done is I have added…
jerfin
  • 803
  • 1
  • 13
  • 28
0
votes
1 answer

UIToolbarItems and UIBarButtonItems not appearing in simulator or getting cut off, am I missing something?

I have created a WKWebView programmatically with some UIBarButtonItems. A "Open" button on the top right, and 3 UIToolbarItems on the bottom for ProgressView, flexibleSpace, and reload button. My simulator is not able to load these onto the screen…
Johan Park
  • 17
  • 4
0
votes
1 answer

Is it possible to get the SystemItem of a UIBarButtonItem in Swift?

I have a bunch of UIBarButtonItems in a UIToolbar. Each of which has its SystemItem set in Storyboard, so that they'll look like system icons. I'd rather not make an IBAction for each and every one of them, so I need some way to differentiate them…
0
votes
1 answer

Getting destination ViewController from UIBarButtonItem?

I have programmed UIBarButtonItem so that it does some action before switching to a previous view. I was wondering how do I get the viewcontroller of that transitioning scene from my UIBarButtonItem? So, scene 1 -> scene 2 (current scene) -> scene 1…
user10416282
  • 33
  • 1
  • 7
0
votes
2 answers

Why adding barBarttonItem won’t work if created out of scope where it’s added?

I ran into some problems when adding barButtons and found the solution in the answer to another question, but the it didn’t explain why you must create and add the buttons in the same scope. I want to know why you can’t create the buttons in class…
Antonia Zhang
  • 103
  • 11
0
votes
1 answer

Is there a way to rotate the Refresh Icon of UIBarButtonSystemItemRefresh until refresh done?

I'm setting up a UIBarButtonSystemItemRefresh, and want to rotate the refresh icon of the UIBarButtonSystemItemRefresh until refresh done. How can I achieve this? self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]…
RateRebriduo
  • 265
  • 3
  • 11
0
votes
1 answer

Re-instantiate storyboard navigation bar buttons

I have two bar button items set up in storyboard and connected to these outlets: @IBOutlet weak var sideMenuButton: UIBarButtonItem! @IBOutlet weak var selectButton: UIBarButtonItem! When select button is pressed, I replace those buttons with…
HemOdd
  • 697
  • 1
  • 7
  • 23
1 2 3
99
100