
- iOS Tutorial
- iOS - Home
- iOS - Getting Started
- iOS - Environment Setup
- iOS - Objective-C Basics
- iOS - First iPhone Application
- iOS - Actions and Outlets
- iOS - Delegates
- iOS - UI Elements
- iOS - Accelerometer
- iOS - Universal Applications
- iOS - Camera Management
- iOS - Location Handling
- iOS - SQLite Database
- iOS - Sending Email
- iOS - Audio & Video
- iOS - File Handling
- iOS - Accessing Maps
- iOS - In-App Purchase
- iOS - iAd Integration
- iOS - GameKit
- iOS - Storyboards
- iOS - Auto Layouts
- iOS - Twitter & Facebook
- iOS - Memory Management
- iOS - Application Debugging
- iOS Useful Resources
- iOS - Quick Guide
- iOS - Useful Resources
- iOS - Discussion
How to create a left-arrow button on a Toolbar on iPhone/iPad?
To create a button on toolbar we'll need to use two different components of iOS and another image that is a back arrow. Before that let's see what those components are
Toolbar − Toolbar is a native iOS component that is used to display items or toolbar on the bottom of screen.
Bar Button item − It is a button that's usually created on a Toolbar or a navigation bar.
When a toolbar is created using storyboard, it comes with a Bar button item.
Let's start by creating a new project, in the main.storyboard give some background color to the only viewController we have.
From the object library drag and drop a toolbar to the bottom on that view Controller. It will automatically create a bar button too.
Select the toolbar, give it a bottom, left and right constraint of 0 and an height of 50.
Download a back image and select the bar button item on the toolbar. Select the image from attribute inspector. From the attribute inspector you can select properties like Image, title, tint color etc.
Now run the project and it looks like −
The toolbar automatically arranges items and give them equal spaces depending upon the number of items.
- Related Articles
- How to hide Back Button on navigation bar on iPhone/iPad?
- HTML5 inline video on iPhone vs iPad/Browser
- How to create a Button on a Tkinter Canvas?
- How to Debug JavaScript on iPad?
- How to create a ToolBar in JavaFX?
- How to Block a Number on an iPhone?
- How do you create a Button on a Tkinter Canvas?
- How to create a "toggle switch" (on/off button) with CSS?
- How to create a vertical toolbar in Java?
- Java Program to create Arrow Button positioning North
- How to create Left arrow icon using jQuery Mobile?
- How to implement click event on toolbar icon?
- Create a caret arrow icon that represents dropdown button with Bootstrap
- How to generate Unique ID of device for iPhone/iPad using Swift?
- How to go through all text fields with the "Next" Button on the iPhone/iOS Keyboard?
