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

UIBarButtonItem text two colours

i'm trying to find solution to change my UIBarButTonItem text in two colours , i find some functions for UILabel, i change it by my task: extension NSMutableAttributedString { func setColorForText(textForAttribute: String, withColor color:…
0
votes
1 answer

Custom UIButton to drill up from table view?

Ive put in a custom "Back" UIBarButtonItem, which is from an Image i made in photoshop. Ive managed to make it appear just fine, my problem is making it work. My button does nothing, im assuming because i havent assigned any actions to it. I just…
Andyy
  • 485
  • 8
  • 27
0
votes
1 answer

How to use free tab bar icon images as bar button image?

I got some free image icons for iOS, for example, http://glyphish.com/ but I think these images is for tab bar icons, not for bar button images. I used these images to bar button, but it isn't good to look due to alphas in image. Pure-white image is…
moon6pence
  • 712
  • 9
  • 24
0
votes
1 answer

Make UIBarButtonItem open a link in safari?

Hello I'm all new to the iPhone development thingy, so I would appreciate some help here. I would like my UIBarButton to close the app and then open up a link in safari. in the .h file #import @interface MoviesViewController :…
0
votes
0 answers

Tap area of UIBarButtonItem is smaller than its CustomView

I have a UIBarButtonItem with a UIView inside (let's say container) containing a UIImageView and another UIView for showing notification state. The container also has a UITapGestureRecognizer. But the problem is that taps work only in a small area…
0
votes
1 answer

initializing a UIBarButtonItem with a UIImage and resizing the image in iOS

I am trying to initialize a UIBarButtonItem with an Image. The available method is initWithImage. When I do this, the image is just a block of color. I want to be able to resize this image. How do I do that?
Namratha
  • 16,630
  • 27
  • 90
  • 125
0
votes
2 answers

Swift: UIBarButtonItem with bigger size than UIToolbar

I have a UIToolbar installed on my Viewcontroller on the bottom via Storyboard. I also added a bottom in the Storyboard and now I want to give this bottom a greater height than the toolbar itself. It should be something like that, but it cannot be a…
Pauli
  • 343
  • 1
  • 4
  • 17
0
votes
1 answer

Set Textfield Data on click save button in iphone

I have a modalviewcontroller and have two buttons on it: Cancel and Save. There is a UITextField which is editable. Whenever I click on save button I do save it but the text doesnot get save because when I click on the button to open the…
0
votes
1 answer

Selector UIView.endEditing crashing with UIBarButtonItem but it's working with UITapGestureRecognizer Swift 5

I want to dismiss keyboard when click on done button of UIBarButtonItem and I Don't want to add selector function @objc method. #selector(UIView.endEditing) - This selector is working fine with UITapGestureRecognizer let tapGesture =…
Yogesh Patel
  • 1,893
  • 1
  • 20
  • 55
0
votes
3 answers

UIButton not showing in iOS

Following is a code to display a button to the toolbar. UIButton myButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *myImage = [UIImage imageNamed:@"img1.png"]; [myButton setBackgroundImage:myImage…
Namratha
  • 16,630
  • 27
  • 90
  • 125
0
votes
1 answer

I want to rotate a bar button item - Swift

I encountered with an issue. I want to display 3 buttons, that are used for filtering my tableView. I found an appropriate images from “SF symbols.” Except one, which is the same I used for filtering(bigger to smaller) but is rotated on 180 degrees.…
Suprafen
  • 58
  • 3
  • 9
0
votes
1 answer

How to add custom/normal button on top of navigation bar?

I want to put a custom button in the navigation bar area, but there appear to be limitations for how much you can customize a nav bar item. I want to do a basic button with a rounded square background and custom color for the title and background.…
0
votes
1 answer

How to display leftBarButtonItem look same as backBarButtonItem in Objective C iOS

I've a backBarButtonItem for few view controllers it is default showing with back arrow and text I wanted to create a leftBarButtonItem for some other view controller(which are presented instead of push). How can I create a leftBarButtonItem should…
iOSDude
  • 274
  • 2
  • 25
0
votes
2 answers

Making a dynamic NavigationBar

I want a UINavigationBar whose contents change in response to other events in the app. Most immediately, I'd like to have the buttons on the bar loaded dynamically in response to other variables in the program. But in the more general case I'd like…
baudot
  • 1,618
  • 20
  • 33
0
votes
1 answer

How to apply custom UIimage to editButtonItem in Swift?

I'm not sure how to apply custom UIImage to editButtonItem. In my view controller, I configured the bar button item as editButton. func configureNavigationBar() { navigationItem.largeTitleDisplayMode = .always …
Yuuu
  • 715
  • 1
  • 9
  • 32