Questions tagged [uibaritem]

UIBarItem is an abstract superclass for items added to a bar that appears at the bottom of the screen. Items on a bar behave in a way similar to buttons (instances of UIButton). They have a title, image, action, and target. You can also enable and disable an item on a bar. Available in iOS 2.0 and later in UIKit.

UIBarItem is an abstract superclass for items added to a bar that appears at the bottom of the screen. Items on a bar behave in a way similar to buttons (instances of UIButton). They have a title, image, action, and target. You can also enable and disable an item on a bar.

Click Here for Apple Docs of UIBarItem.

13 questions
138
votes
4 answers

How big should a UIBarButtonItem image be?

I'm looking to create my own custom Sort By Date and Sort By Number buttons that I plan on placing in the navigation bar as the right button. How big should my image be to appropriately fill the space -- the UIBarItem documentation page doesn't list…
Epsilon Prime
  • 4,576
  • 5
  • 31
  • 34
37
votes
5 answers

How do you use setTitleTextAttributes:forState in UIBarItem?

How do you use setTitleTextAttributes:forState: in UIBarItem in iOS? How do you set the NSDictionary? Can't make it work and documentation isn't very clear about that. From the documentation: setTitleTextAttributes:forState: Sets the title’s text…
4
votes
3 answers

Get rid of the space on the right side of a UINavigationBar

So, this is what I'm trying to accomplish: It's a UINavigationBar with a UIBarButtonItem that gets initialized with a custom UIButton. Basically like this: UIButton *favoriteButton = [UIButton buttonWithType:UIButtonTypeCustom]; [favoriteButton…
Pascal
  • 5,879
  • 2
  • 22
  • 34
3
votes
1 answer

transparent navigation bar 's bar button items

I use this code to make my navigation bar transparent to make the background image continue to whole screen: navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default) …
berkt
  • 99
  • 1
  • 8
3
votes
0 answers

Setting title attributes for UIBarButtonItemStyleDone using appearance proxy

I'm customizing my UIBarButtonItem buttons appearance using appearance proxy. While in the UIBarButtonItem class you can differentiate these buttons by button style ad you can customize all kinds of images, title position etc., you cannot customize…
3
votes
3 answers

Why UIBarButtonItem not getting clicks in UIToolbar set as inputAccessoryView of UITextField?

UIBarItem does not respond to clicks inside UIToolbar which is setup as inputAccessoryView on a UITextField. The button does not show click animation when I try to click it, callback does not get called. My setup looks like: @interface…
stefanB
  • 77,323
  • 27
  • 116
  • 141
2
votes
1 answer

How to change the badge background color in UIBarbutton?

I am using uibarbutton in my view to show the notification badge number. I have used following code to display. barButtonBadge.badgeValue = @"5"; How can I change the background color of this badge number? Right now it is taking default color.
2
votes
0 answers

iOS resize textfield in toolbar when button width changes

I still stuck in fixing my code for iOS 7.1 with the new option "button shapes". Selecting it is increasing the width of an UIButtonItem in my programmatically created toolbar. This will move an text field to the right because I do not know how to…
JFS
  • 2,992
  • 3
  • 37
  • 48
1
vote
3 answers

Cannot modify UIBarButton tintColor

I have a UIBarButton in my navigation bar, I set an image (silhouette.png) to it from the storyboard, and I can change that image's tint (color) at will: if let num2 = Int(s, radix: 16) { //s="00ff00" flamingoBtn.tintColor =…
Josh
  • 6,251
  • 2
  • 46
  • 73
1
vote
3 answers

Navigation Bar not showing in Storyboard

I embeded in a navigation controller to a viewController, and a nav bar item is showing (in the outline editor), and I can change the title, but the navigation bar is not showing in the (outline editor) and I therefore cannot change the bar tint…
Horray
  • 693
  • 10
  • 25
0
votes
0 answers

Put CAShapeLayer on top of UIImage in UIBarItem

Background I followed this tutorial to achieve custom badges: http://www.stefanovettor.com/2016/04/30/adding-badge-uibarbuttonitem/ Problem The badge layer is placed underneath the UITabBarItem image. How do I place it on top of the image? I tried…
0xRLA
  • 3,279
  • 4
  • 30
  • 42
0
votes
1 answer

Change the appearance of badge value in UITabBarController iOS?

How can I change the text font and the location of a badge value in a UITabBarController?
user2037296
  • 409
  • 1
  • 5
  • 13
0
votes
2 answers

UIBarItem - access customView as method/property

When creating a UIBarButtonItem with a custom view, is it possible to access that custom view again, without having to keep a pointer externally? Eg: barButtonItem.customView There does not appear to be such a property or method. Once you pass it…
Jasper Blues
  • 28,258
  • 22
  • 102
  • 185