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

Adding and Removing UIBarButtonItems to UINavigationBar from Multiple Views

I currently have a Main Window set up as a UINavigationController (also is the root view controller), and I have two views. The first view is the login screen, and the second screen is a table view screen. What I would like to have happen is to…
0
votes
1 answer

Button image in navigation bar has different appearance. Why?

I'm trying to put a UIBarButtonItem with a custom image on a UINavigationBar. When I do however, the image doesn't look right. I want the button on the navigation bar to look like the one below it. (This is a screenshot from the simulator, by the…
pancake
  • 1,923
  • 2
  • 21
  • 42
0
votes
1 answer

Need to disable (or hide) a bar button in UIWebView depending on the page that's loaded

Part of my iOS app has a UIWebView that has a button bar on the bottom and loads a local index.html file. The 2 buttons on the bar are 'back' and 'done'. The index.html file is a list of downloaded (hence also local) html mini-apps which are loaded…
LeGaTTiS
  • 1
  • 3
0
votes
1 answer

Swift BarButtonItem doesn't update

I have a navigation controller and a root view controller. On this vc I present a table view controller as popover. When a row is selected on this tvc, I execute a delegate method (I know that it is executed) and dismiss the tvc. The delegate is my…
Patrick
  • 552
  • 5
  • 17
0
votes
0 answers

UINavigationItem backBarButtonItem issue during screen transition

I have UINavigationController with 2 view controllers vc1 and vc2 (vc1 pushes vc2). I need to set back button title of vc2, so I do it by: vc1.navigationItem.backBarButtonItem = UIBarButtonItem(title: title, style: .plain, target: nil,…
Paul T.
  • 4,938
  • 7
  • 45
  • 93
0
votes
2 answers

UINavigationController popToRootViewController doesn't reset Title, clear backbutton

I am stuck trying to customize UINavigationController's backbutton. In RootViewController I set self.title in viewDidLoad, and this string appears in Navigation Bar. In -didSelectRowAtIndexPath I create child view controller, configure back button…
Namhcir
  • 825
  • 3
  • 9
  • 16
0
votes
1 answer

UINavigationController UIBarButtonItem not responding to action method

I have a navigation app with a root viewcontroller and a child viewcontroller. In the child -didSelectRowAtIndexPath method, I add a back button with a target / action as follows: When the back button is selected, I want to go back to root view,…
0
votes
1 answer

Add an action to a standard text base UIBarButtonItem

I believe I've followed the steps of other SO threads to invoke an action, via another method, when the UIBarButtonItem is tapped however I keep getting the following error Argument of '#selector' does not refer to an '@objc' method, property, or…
akash23a
  • 127
  • 10
0
votes
2 answers

How to have a real time tableview selected cell counter as a UIBarButtonItem

I'm having difficulty trying to add a UIBarButtonItem with title "Next(#)" where # is a dynamic counter that counts the number of cells selected in the table view as the user is selecting them. The array that tracks the cell selections is built and…
akash23a
  • 127
  • 10
0
votes
0 answers

Reload BarButtonItem after pressing (Change formatted string title)

I have added a bar button item programmatically that will change the temperature units on some variables between Celsius and Fahrenheit and have set it with attributed text via a customView. It is half Bold and half standard text. Whichever unit is…
0
votes
1 answer

NavBar button will not drag into top right corner of UIViewController

I have 2 UIViewControllers. VC1 i embedded into a Navigation controller. I clicked and dragged a UIBarButtonItem to the top right of this VC. I set this button to segue to VC2. When I try to click and drag a UIBarButton Itemt into VC2 it will not…
kitchen800
  • 197
  • 1
  • 12
  • 36
0
votes
5 answers

addGestureRecognizer to rightBarButtonItem with customView

How I can add action to my rightBarButtonItem with customView? Now I have code: override func viewDidLoad() { super.viewDidLoad() configurePhotoProfile() } func configurePhotoProfile() { let imageView = UIImageView() let…
0
votes
1 answer

How to change badge number when button is pressed?

Ive been struggling to change the badge number in cartBtn when a count is placed and the atcbtn is pressed in the cells right now what the CountVC is showing me in the cartBtn is the count of the cell when the atcbtn is pressed, but what im trying…
Evelyn
  • 186
  • 1
  • 4
  • 25
0
votes
2 answers

Adding a UIBarButtonItem programmatically

I'm trying to add a UIBarButtonItem programmatically. let navigation = UINavigationController() let rightBarButton = UIBarButtonItem(title: "LogIn", style: .plain, target: self, action:…
0
votes
0 answers

UIbarbutton action is not working after changed the navigation bar position in iOS

I want to change the navigation bar position. After changing the position my back button action is not working. Actually I have added the navigation bar in my custom view controller. I want to change the navigation bar Y position. If I give…
Devan
  • 147
  • 1
  • 1
  • 8