Questions tagged [uitoolbar]

A toolbar is a control that displays one or more buttons, called toolbar items. A toolbar momentarily highlights or does not change the appearance of an item when tapped.

A UIToolbar is a bar of buttons in an iOS app. As formally defined by Apple, it is a control that displays one or more buttons, called toolbar items. A toolbar momentarily highlights or does not change the appearance of an item when tapped. Navigation controllers can display toolbars on the bottom of their views and manage the items for their child view controllers. The UIToolbar Class Reference can be found here on Apple's developer page.

The UIToolbar is also part of an important group in the iOS user interface, along with the status bar, navigation bar, tab bar, which all have specifically defined appearances and behaviors in iOS apps.

1273 questions
292
votes
24 answers

Creating a left-arrow button (like UINavigationBar's "back" style) on a UIToolbar

I'd love to create a "back" left-arrow-bezel button in a UIToolbar. As far as I can tell, the only way to get one of these is to leave UINavigationController at default settings and it uses one for the left bar item. But there's no way I can find to…
Marco
  • 14,727
  • 6
  • 34
  • 33
259
votes
37 answers

How do I show/hide a UIBarButtonItem?

I created a toolbar in IB with several buttons. I would like to be able to hide/show one of the buttons depending on the state of the data in the main window. UIBarButtonItem doesn't have a hidden property, and any examples I've found so far for…
Sasha
  • 3,215
  • 3
  • 16
  • 20
115
votes
4 answers

Aligning UIToolBar items

I have three UIBarButtonItem created as below. They align left and I'd like to align center so there isn't a gap on the right side. I don't see an align property on UIToolBar. Is there another way to accomplish this? //create some…
4thSpace
  • 41,122
  • 88
  • 267
  • 450
88
votes
5 answers

How to draw a transparent UIToolbar or UINavigationBar in iOS7

I would like an entirely transparent UIToolbar and/or UINavigationBar. I have tried the various incantations suggested for pre- and post-iOS 5 but none seem to work any more. How might this be accomplished in iOS 7?
Ben Packard
  • 24,060
  • 24
  • 94
  • 172
80
votes
5 answers

Set rootViewController of UINavigationController by method other than initWithRootViewController

How Do I set the rootViewController of UINavigationController by a method other than initWithRootViewController? I want use initWithNavigationBarClass:toolbarClass: to deliver a custom toolbar for my NavigationController, so I don't think I can use…
drc
  • 1,795
  • 3
  • 20
  • 26
75
votes
9 answers

How can I add a toolbar above the keyboard?

I have created a UIToolBar programmatically and added a UITextField on it. Now, I need that toolbar to be above the keyboard when I click in another text field. UIToolbar *toolBar=[[UIToolbar alloc]initWithFrame:CGRectMake(0,400,…
Sushil Sharma
  • 927
  • 1
  • 7
  • 9
63
votes
5 answers

UIBarButtonItem with UIImage Always Tinted iOS 7

I'm trying to add a UIBarButtonItem containing a UIImage to a UIToolbar. The image keeps being tinted and I can't get it to show as the original colored image - all I want to do is display an image, verbatim, in a UIBarButtonItem! I'm following…
DiscDev
  • 36,864
  • 20
  • 113
  • 130
60
votes
10 answers

Is there a way to change the height of a UIToolbar?

I've got an UIToolbar in Interface Builder and I've noticed that it's locked to being 44px tall. Of course I'd like to make this larger. Does Apple allow resizing of this control? If so, how do I go about it?
mac_55
  • 3,660
  • 7
  • 27
  • 40
53
votes
5 answers

InputAccessoryView docked at bottom

I'm trying to achieve similar positioning behavior as the bottom text input bar in Apple's Messages app. I have tried many approaches, searched high and low and there are many similar questions but none have been satisfactory. To specify: There is…
48
votes
7 answers

How to add a UIToolbar programmatically to an iOS app?

Can't seem to find a tutorial which does as the question title describes. I'd like to understand just where the UIToolbar needs to be declared and how to get it onto my view layer.
Gerard
  • 4,688
  • 5
  • 48
  • 76
42
votes
6 answers

iOS 7 | Navigation bar / Toolbar buttons very close to status bar

I have a problem when dragging a navigation bar or toolbar (storyboard) to my view controller. UINavigationBar: As you can see in the image above, the right button is almost overlapping the status bar. With a UIToolbar it happens the same: This…
Axort
  • 1,944
  • 2
  • 22
  • 23
38
votes
7 answers

UIToolbar setBackgroundColor doesn't fully change color

I'm trying to set the background color of a UIToolBar. I tried selecting the color from IB's Attribute Inspector, and tried setting it programmatically through setBackgroundColor:[UIColor ...]. Both solutions work, but only partially: the color…
BkdD
  • 583
  • 1
  • 4
  • 13
36
votes
5 answers

Leaving inputAccessoryView visible after keyboard is dismissed

What I'm trying to do is to create something similar to the "find on page" search function in Safari on iPad. I'm using a UIToolbar with some items in it and attached it to the keyboard by setting it as an inputAccessoryView on the UITextField.…
Tom van Zummeren
  • 8,729
  • 12
  • 48
  • 59
34
votes
6 answers

iOS11 UIToolBar Contentview

In iOS 11 buttons and text field are unresponsive being subviews of UIToolBar. Comparing view hierarchy to iOS 10 we see there is a _UIToolBarContentView over all subview of UIToolBar. For instance, this new layout of the UIToolBar breaks…
Mustard
  • 367
  • 3
  • 5
32
votes
3 answers

How to add a UIToolbar to a UITableViewController programmatically?

I have opted to use a UITableViewController without a nib. I need a UIToolbar at the bottom with two buttons. What is the simplest way of doing that? P.S. I know that I can easily use a UIViewController and add a UITableView however I want things to…
jini
  • 10,563
  • 34
  • 95
  • 166
1
2 3
84 85