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.

uitoolbar
Filter by
Sorted by
Tagged with
294 votes
24 answers
182k views

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 ...
Marco's user avatar
  • 15k
275 votes
39 answers
162k views

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 ...
Sasha's user avatar
  • 3,435
117 votes
4 answers
68k views

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 ...
4thSpace's user avatar
  • 44k
92 votes
5 answers
113k views

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 ...
drc's user avatar
  • 1,915
89 votes
5 answers
40k views

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 ...
Ben Packard's user avatar
  • 26.3k
77 votes
9 answers
74k views

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=[[...
Sushil Sharma's user avatar
63 votes
5 answers
24k views

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, ...
DiscDev's user avatar
  • 38.9k
61 votes
10 answers
67k views

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 ...
mac_55's user avatar
  • 4,170
54 votes
5 answers
22k views

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 ...
Stian Høiland's user avatar
50 votes
7 answers
82k views

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's user avatar
  • 4,818
42 votes
6 answers
36k views

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 ...
Axort's user avatar
  • 2,044
39 votes
7 answers
31k views

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 ...
BkdD's user avatar
  • 593
38 votes
5 answers
12k views

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 ...
Tom van Zummeren's user avatar
36 votes
10 answers
63k views

How to hide the navigation bar and toolbar as scroll down? Swift (like myBridge app)

I want to hide a toolbar and nav bar as I scroll down a page. And return it as I scroll up. How is this possible? How would I go about detecting the drag? Do I use pan gesture or is this down with ...
Lyndon King McKay's user avatar
35 votes
6 answers
6k views

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, ...
Mustard's user avatar
  • 377
32 votes
3 answers
27k views

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 ...
Strong Like Bull's user avatar
32 votes
11 answers
20k views

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 ...
Nathan de Vries's user avatar
27 votes
5 answers
34k views

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 ...
StackThis's user avatar
  • 1,262
26 votes
1 answer
9k views

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 ...
Luca Torella's user avatar
  • 8,074
25 votes
10 answers
31k views

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 ...
RusHughes's user avatar
  • 1,191
25 votes
1 answer
21k views

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 ...
Electro-Bunny's user avatar
25 votes
3 answers
12k views

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 ...
akaii's user avatar
  • 467
24 votes
3 answers
22k views

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 ...
outerstorm's user avatar
23 votes
2 answers
5k views

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 = [[...
user774150's user avatar
  • 1,072
23 votes
3 answers
12k views

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 ...
wolverine's user avatar
  • 2,987
22 votes
3 answers
15k views

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" ...
Kent's user avatar
  • 1,715
22 votes
5 answers
12k views

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(...
Antoine's user avatar
  • 23.8k
19 votes
5 answers
27k views

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 ...
Vivian 's user avatar
  • 797
19 votes
3 answers
5k views

Layout Constraint Errors with simple UIToolar for keyboard inputAccessoryView

I was getting a lot of layout constraint errors so I created a new project and simply have a UIToolbar and a UITextField to try and troubleshoot the problem. Even with a clean project, I still get ...
Anthony's user avatar
  • 830
19 votes
2 answers
10k views

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 ...
samvermette's user avatar
  • 40.4k
18 votes
2 answers
13k views

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:...
user523234's user avatar
  • 14.6k
18 votes
4 answers
9k views

UIDatePicker with UIToolbar

I'm trying to implement UIToolbar on UIDatepicker to dismiss it when touching "Done" button. But when I tap on the button, the datepicker is scrolling and the action button doesn't work. Here is my ...
Thlbaut's user avatar
  • 649
17 votes
5 answers
20k views

Adding tool bar on top of the uikeyboard

I have a toolbar and i would like to place it on top of the keyboard. In the keyboardwillshow notification, i tried to add toolbar to the keyboard but no luck, i cant add Please let me know ...
user198725878's user avatar
16 votes
8 answers
12k views

How to make UIToolbar have a Clear Background?

I have a UIToolbar that has a white tint, with a bar button item, followed by some flexible space, followed by another bar button item. I would like to make the toolbar completely clear so that I can ...
Kyle Rosenbluth's user avatar
16 votes
10 answers
21k views

Custom UIBarButtonItems from UIButtons with custom images - is it possible to make the tap targets larger?

I'm making UIBarButtons as follows: // Create "back" UIBarButtonItem UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom]; backButton.frame = CGRectMake(0, 0, 28, 17); [backButton ...
Doug Smith's user avatar
  • 29.9k
16 votes
4 answers
16k views

Custom UINavigationController UIToolbar Background Image

I have an iPhone application using UINavigationController and would like to customize the elements with custom background images. I was able to do this for the UINavigationController's UINavigationBar ...
Chris's user avatar
  • 559
15 votes
4 answers
14k views

UIToolbar height on device rotation

From the iOS Human Interface Guidelines, iOS UI Element Usage Guidelines On iPhone, take into account the automatic change in toolbar height that occurs on device rotation. In particular, ...
0xced's user avatar
  • 25.8k
15 votes
4 answers
20k views

iOS 7 BarButtonItem with image and title

I'm trying to figure out how can I achieve something like this: This is a toolbar and I'd like to keep the button title text without having to create the whole image with icon AND text. How can I add ...
Fred Collins's user avatar
  • 5,014
15 votes
1 answer
10k views

UISegmentedControl, UIToolbar and UINavigationItem

I've create a UISegmentedControl and successfully attached it to my navigationItem.tableView. But when I try instead to attach it to a UIToolbar, it blows up. I'm sure I've seen UISegementedControls ...
Luther Baker's user avatar
  • 7,331
15 votes
4 answers
6k views

UINavigationController bar covers its uiviewcontroller's content

I have a UIViewController, MyViewController, with a UIToolbar at the top. Using interface builder the doc outline looks like this: View - subview1 - subview2 - UIToolbar - Bar Button ...
roro's user avatar
  • 265
14 votes
6 answers
21k views

Hide UIToolbar UIBarButtonItems

I have a UIToolbar that I set up using IB with three buttons, left, middle and right. In some situations I would like to not display the middle button. Does anybody know of a way to hide a specific ...
jmurphy's user avatar
  • 1,891
14 votes
1 answer
10k views

UIToolbar items not showing

I have a UINavigationController that gets pushed a DetailsViewController. In this DetailsViewController, I want to use the toolbar that comes with every UINavigationController (atleast, since iPhone ...
NSSec's user avatar
  • 4,491
14 votes
4 answers
10k views

How to change SFSafariViewController ToolBar color

Expected Output: I want to change the ToolBar color to Dark Black. Actual Output: ToolBar is light Grey color. Here is the code: let webViewController = SFSafariViewController(URL: url, ...
Srikanth Adavalli's user avatar
14 votes
3 answers
8k views

make a UIBarButtonItem with customView behave like Flexible-Space item

I have a UIBarButtonItem that has a UITextField as its customView. The toolbar contains this item and a few buttons. As the toolbar resizes (say on a device-orientation change) I want the ...
TomSwift's user avatar
  • 39.4k
13 votes
10 answers
21k views

How to hide inputAccessoryView without dismissing keyboard

I am using a toolbar in the inputAccessoryView property of a textView. When the keyboard shows, it displays the toolbar as expected. When the device is rotated I want to remove the toolbar. I tried: ...
Dean Davids's user avatar
  • 4,194
13 votes
7 answers
17k views

How to determine position of UIBarButtonItem in UIToolbar?

What's the easiest way to determine the x,y location of a UIBarButtonItem in a UIToolbar? The only answer I found is in any way to know where uibarbuttonitem has been drawn. All proposed answers ...
Hisham's user avatar
  • 1,305
13 votes
7 answers
13k views

iOS 10, UIToolbar background color does not change

I have an app that's been around since iOS 8. the way it's working is that you have a UITableView and tap on cells to produce a score, depending on the score the UItoolbar at the bottom changes color ...
Jp4Real's user avatar
  • 2,002
13 votes
2 answers
19k views

UIToolbar tint on iOS 4

just switched to iOS 4 on my iPhone 3GS and some of my apps broke. One issue I had is that I had a UIToolbar with some buttons, tinted to pink, that worked well on the 3.1.3 OS. After upgrading to ...
Oded Ben Dov's user avatar
  • 10.2k
12 votes
5 answers
13k views

Problem adding UIBarButtonItems to a ToolBar

I have a UINavigationController with a UITableViewController in it. I want to show a ToolBar on the bottom with UIBarButtonItem's. The ToolBar is showing up, but the buttons won't appear. Anyone knows ...
Olivier de Jonge's user avatar
12 votes
5 answers
12k views

Can I center a UIToolbar item?

I am putting a label on a UIToolbar (per this tip: Adding a UILabel to a UIToolbar). But the toolbar has a button on the left side, and so flexible spaces throw the label off the center, which is ...
Ben Zotto's user avatar
  • 70.5k

1
2 3 4 5
26