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
2 answers

How to show popUp with opening/closing effects when selecting UIBarButtonItem from NavigationBar in Swift 5?

Is this any Default Property in updated iOS14 or is it made in SwiftUI or is it a custom UIView? If it is Default Property, then how to use it ? (is it available in Apple Documentation) If it is in SwiftUI , How to use this property in Swift5…
Nayan Dave
  • 1,078
  • 1
  • 8
  • 30
0
votes
2 answers

Translating text on buttons when using mfmailcomposeviewcontroller

How is it possible to change the title of the UIBarButtonItem's when using mfmailcomposeviewcontroller? I don't want the text "cancel"/"send" and I also do not need the save/delete draft option which prompt the user when he/she taps "cancel".
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
0
votes
1 answer

swift data not transferred from UIBarButtonItem to another viewcontroller

This is an extension of an earlier question:- ios Swift Items do not get added to cart The original issue is resolved. Now I have a supplementary hitch:- The issue is in CartViewController - When I click on "Checkout(2)" rightBarButtonItem in the…
askit
  • 205
  • 4
  • 21
0
votes
1 answer

How to properly translate view.convert UIBarButtonItem frame in Nav bar to the main Window Coordinates

I'm trying to setup a new feature walkthrough for my users, and as part of that I'd like to draw a circle around a relevant UI element. I'm trying to draw a circle around a UIBarButtonItem in the upper right of the NavigationBar, but when I…
N.W
  • 672
  • 2
  • 8
  • 19
0
votes
1 answer

UIBarButtonItem shows ? with square when tap on it

All, I used fontawsome icon for UIBarButtonItem. It looks good but when tapping on it changes the icon to "?" with square. See attached images. Normal : When on tap : let searchBtn = UIBarButtonItem(title: String.fontAwesomeIcon(name: .search),…
Manish
  • 608
  • 1
  • 11
  • 23
0
votes
2 answers

Navigation bar back button image align with screen edge

Does anyone know how I can move a back button image to the edge of the screen? This is what it looks like right now: and this is how I want it to look:
0
votes
0 answers

How do I use @IBInspectable with bar button items?

I have added an extension like this: extension UINavigationController { @IBInspectable var hideLeftItem: Bool { get { return self.hideLeftItem } set { self.navigationItem.leftBarButtonItem = nil } …
0
votes
1 answer

My UIBarButtonItem Code not executing, but everything is linked up properly

This is quite a simple yet perplexing problem. I have a UIBarButtonItem: @IBAction func doneButtonPressed(_ sender: UIBarButtonItem) { guard let name = nameTextField.text, let estimatedHeight = estimatedHeightTextField.text, …
user10368914
0
votes
1 answer

Make whole UIView clickable in nav bar button?

I'm making a left bar button with a custom view (btnView). I want this view to be positioned on the edge of the screen, which Swift doesn't allow since it moves the bar button to the right if I try adding a view that's positioned further on the…
Big Chungus
  • 185
  • 1
  • 3
  • 13
0
votes
1 answer

UIBarBUttonItem image

I have a toolbar created programaticaly with 3 buttons (only 1 shown here). After a lot of Googling I was able to set a nice background image but now I don't know where to put the code for the action: target:self action:@selector(pressButton3:)…
alex
  • 1
  • 2
0
votes
2 answers

iphone how to disable UIBarButtonItem

This question has been asked many times, but I tried every solution and none of them solved my problem. Here's the toolbar creation code : - (id)initWithBlogArticle:(BlogArticle *)theArticle { if (self = [super init]) { …
teum
  • 125
  • 3
  • 12
0
votes
4 answers

UIBarButtonItem not reacting after click

From the rootViewController I navigate to a UIViewController if (self.contr == nil) { ExampleViewController *controller = [[ExampleViewController alloc] initWithNibName:@"Example" …
Adriana
  • 806
  • 11
  • 36
0
votes
1 answer

Change bar button item programmatically after user presses it Swift

I am trying to make a feature where if the user presses the speaker button (a bar button item), then a speaker with a slash through it will replace the original button. Is there an easy way of doing this? I know that it must be done programatically…
rice888
  • 51
  • 8
0
votes
2 answers

UIBarButton won't show up on Table View within Tab Controller

noob question regarding ios development. In a previous project, I have a UITableViewController, to which I am adding a button in the viewDidLoad method, like this: UIBarButtonItem *button = [[UIBarButtonItem alloc] …
thekevinscott
  • 5,263
  • 10
  • 44
  • 57
0
votes
1 answer

problem to give colors for BarButtonItem

i have a ToolBar in my view controller.i need to show one icon in right side of the ToolBar. so i added a BarButton item and displayed icon image there.but the is a problem with icon color.it displaying as black which is not looking good and also…
Vipin
  • 4,718
  • 12
  • 54
  • 81