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.

1285 questions
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…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
32
votes
11 answers

Hiding a UINavigationController's UIToolbar during viewWillDisappear:

I've got an iPhone application with a UITableView menu. When a row in the table is selected, the appropriate view controller is pushed onto the application's UINavigationController stack. My issue is that the MenuViewController does not need a…
Nathan de Vries
  • 15,481
  • 4
  • 49
  • 55
27
votes
5 answers

Custom background image on UIToolbar in IOS5 SDK

Downloaded IOS5 SDK yesterday, and this code which I use to set my UIToolbar's background to a custom image stopped working. If I set the target to IOS4.3 and below it still works. [self.bizToolbar insertSubview:[[[UIImageView alloc]…
StackThis
  • 1,262
  • 1
  • 14
  • 23
26
votes
1 answer

UIToolbar not showing UIBarButtonItem

I'm using a storyboard and I've a split view where the master is a UITableViewController. Like the iPad Mail app, I'd like to display a UIToolbar. I wasn't able to add the toolbar via storyboard but I managed to add it programmatically. I'm also…
Luca Torella
  • 7,974
  • 4
  • 38
  • 48
25
votes
1 answer

iOS 5: Positioning Bar Button Item in a toolbar with Xcode/Storyboard

I have an existing toolbar in my View... when I drag a "Bar Button Item" into the tool bar it gets slammed to left side of the toolbar (I would like it to sit on the right edge). Attempting to drag the Bar Button only results in it being "gravity…
Electro-Bunny
  • 1,380
  • 2
  • 12
  • 33
25
votes
10 answers

Can I give a UIToolBar a custom background in my iPhone app?

Is it possible to give a UIToolBar a custom background from an image rather than the usual tinted blue/black fade out? I've tried giving the view a background and setting the opacity of the UIToolBar but that also affects the opacity of any…
RusHughes
  • 1,191
  • 2
  • 12
  • 17
24
votes
3 answers

How do you adjust the frame or vertical alignment of a UIBarButtonItem contained by a UIToolbar instance?

Horizontal positioning of UIBarButtonItems is no problem, I can simply pad the space with fixed/flexible space items. However, I can't seem to adjust the toolbar item vertically. UIToolbar has no alignment property, and UIBarButtonItem has no way of…
akaii
  • 457
  • 1
  • 6
  • 15
24
votes
3 answers

iOS Autolayout and UIToolbar/UIBarButtonItems

I have an iOS view with autolayout enabled and have a UIToolbar with a UISearchBar and UISegmentControl contained with the toolbar. I want the UISearchBar to have a flexible width so I need to add a constraint to force this, but from what I can…
outerstorm
  • 712
  • 3
  • 7
  • 16
23
votes
2 answers

UIToolbar with UIBarButtonItem LayoutConstraint issue

I'm creating a UIToolbar with UIBarButtonItem in it programatically. I'm not using .xib or storyboard for this ViewController. Here's the code of how I created it. NSMutableArray *items = [[NSMutableArray alloc] init]; UIBarButtonItem…
23
votes
3 answers

UIBarButtonItem Image is not shown and instead a white rectangle in the size of image is shown, Why?

With whatever image I try to intialize the UIBarButtonItem, its just showing a white background in the size of the image. Even when I tired in interface builder, the result is the same. All these images when used with other objects works perfectly.…
wolverine
  • 2,967
  • 5
  • 31
  • 35
22
votes
3 answers

UINavigationBar appearance refresh?

In my iPad app I have an application settings view. One of the options lets the user switch interface color scheme. The settings view is loaded by segue to a separate view controller than my "main" app's window. When they pick a new color I switch…
Kent
  • 1,705
  • 3
  • 16
  • 26
21
votes
5 answers

Adjust vertical position of UIBarButtonItem title inside UIToolbar

Is it possible to adjust the title of a UIBarButtonItem inside an UIToolbar? I've tried the following lines of code without success: UIBarButtonItem.appearance().setTitlePositionAdjustment(UIOffset(horizontal: 30, vertical: 30), forBarMetrics:…
Antoine
  • 23,526
  • 11
  • 88
  • 94
19
votes
5 answers

Add UIToolBar to all keyboards (swift)

I'm trying to add a custom UIToolBar to all of my keyboards with as little repetition. The way I'm currently doing it requires me to add the code to all my viewDidLoads and assign every textfield's delegate to the viewController I'm using. I have…
Vivian
  • 797
  • 2
  • 6
  • 13
19
votes
2 answers

Get nice, dark UIToolbar blur as in Facebook iOS 7 app

Does anyone know what Facebook uses for their blurred toolbar? Now, I KNOW there are already countless threads about iOS 7 blur. They all come to these same solutions: Use a UIToolbar with translucent set to YES, and then set its barTintColor…
samvermette
  • 40,269
  • 27
  • 112
  • 144
18
votes
2 answers

Add UITextField to UIToolbar

I tried this to add UITextField to a UIToolbar but got a run-time error with reason as: [UITextField view]: unrecognized selector sent to instance ... [toolbar setItems:[NSArray arrayWithObjects:textField, nil]]; toolbar is an instance of UIToolbar…
user523234
  • 14,323
  • 10
  • 62
  • 102
1
2
3
85 86