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.
1,284
questions
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 ...
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 ...
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 ...
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 ...
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 ...
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=[[...
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, ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 = [[...
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 ...
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" ...
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(...
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 ...
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 ...
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 ...
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:...
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 ...
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
...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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:
...
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 ...
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 ...
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 ...
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 ...
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 ...