


Build a tab bar multi-page application with Storyboard UI_html/css_WEB-ITnose
Main content
Brief description
The tab bar application is a multi-view application that displays a row of buttons at the bottom of the screen, called the tab bar. A single button will activate a new view controller (tab) and display a new view, while still retaining the tab bar at the bottom. There are 3 tab bars as shown in the picture below.
Another common multi-view iPhone app is a navigation-based app. This type of app has a navigation controller and uses navigation Columns control a hierarchical series of views. Navigation controllers keep track of the view depth they are in and provide you with control to return to the previous view. The tab bar is used to select one option from two or more options, and only one can be selected (the tab bar is mostly used to select between parallel pages).
Reference: This brief introduction mainly refers to Chapter 6 of "Mastering iOS Development": Multi-View Applications
Storyboard Building Tab Bar
Here we describe how to use Storyboard to build a tab bar multi-view application UI.
1 Select Tab Bar Controller
First select a Tab Bar Controller in the object selection of Storyboard:
In Storyboard we can see the following In the UI interface shown in the figure, we do not need to operate the first page (Tab Bar Controller) because our operations on its tab pages (the next two pages) will automatically update to the Tab Bar Controller.
2 Add our own TableView Controller
As you can see from the picture above, the Tab Bar Controller comes with it when it is dragged into the Storyboard Two tabs, which are of type View Controller, we can remove them and add our own view controllers according to our needs.
First we delete the first built-in View Controller, and then drag in a TableView Controller from the right;
As shown in the picture above, After adding your own TableView Controller, create a jump from the Tab Bar Controller to the TableViewController (hold down Control and drag the line from the Tab Bar Controller to the TableViewController). From the picture above, we can see that in addition to the usual push, modal, and custom methods In addition, there is one more View Controllers, here we should choose this connection;
3 Modify the label style in the label bar
Select the TableViewController we just added The tab icon (Tab Bar Item) in Two items. The first is the text displayed below the label icon, and the second is the icon ICON. The following is the effect after our modification:
At this time, we see that the tab bar in the Tab Bar Controller has been automatically updated (this is why we mentioned earlier that the Tab BarController does not need to be modified):
Similarly, we can delete the other ViewController that comes with it and add the TableViewController we need, and then repeat the operation we just did:
4 Add a new Controller
The Tab BarController we dragged in earlier has only two View Controllers, and there are only two tab icons in the tab bar. Here we add a new view controller TableViewController
Here we can see that when the newly added TableView Controller class Tab Bar Controller is not connected, the tab bar only has two tabs. At the same time, there is no tab bar in the newly added TableView Controller. Then we connect the Tab Bar Controller according to the method just now, and the operation is exactly the same.
You can see that after connecting the Tab Bar Controller and the TableView Controller, the number of tab bar labels in the Tab Bar Controller automatically becomes 3. Similarly, we can modify the label style in the newly added TableViewController.
At this point, a tab bar multi-page UI with three TableView tabs is ready. The next step is to add the Controller and Model, which we will not introduce here.
5 Runs
In order to see the switching of tabs, we added Label to each page, indicating the switching of pages:
6 Reference
For specific methods, you can also refer to this video, which is more detailed:
http://teamtreehouse.com/library/build-a-selfdestructing-message -iphone-app-2/designing-and-starting-the-app/a-storyboard-with-a-tab-bar-controller
Notes
here The tab bar multi-page application is just a single tab bar display. We have not yet mentioned how to enter the tab bar page, how to enter it, and what the differences are. We will discuss it in detail in the article "Tab Bar Controller and Navigation Bar" later. narrate.
The Demo source code can be downloaded here:
Guo Liu
First edited on Saturday, 8/23/2014

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

If you encounter the Unable to save changes error while using the Photos app for image editing in Windows 11, this article will provide you with solutions. Unable to save changes. An error occurred while saving. Please try again later. This problem usually occurs due to incorrect permission settings, file corruption, or system failure. So, we’ve done some deep research and compiled some of the most effective troubleshooting steps to help you resolve this issue and ensure you can continue to use the Microsoft Photos app seamlessly on your Windows 11 device. Fix Unable to Save Changes to Photos App Error in Windows 11 Many users have been talking about Microsoft Photos app error on different forums

In Windows, the Photos app is a convenient way to view and manage photos and videos. Through this application, users can easily access their multimedia files without installing additional software. However, sometimes users may encounter some problems, such as encountering a "This file cannot be opened because the format is not supported" error message when using the Photos app, or file corruption when trying to open photos or videos. This situation can be confusing and inconvenient for users, requiring some investigation and fixes to resolve the issues. Users see the following error when they try to open photos or videos on the Photos app. Sorry, Photos cannot open this file because the format is not currently supported, or the file

Microsoft Paint not working in Windows 11/10? Well, this seems to be a common problem and we have some great solutions to fix it. Users have been complaining that when trying to use MSPaint, it doesn't work or open. Scrollbars in the app don't work, paste icons don't show up, crashes, etc. Luckily, we've collected some of the most effective troubleshooting methods to help you resolve issues with Microsoft Paint app. Why doesn't Microsoft Paint work? Some possible reasons why MSPaint is not working on Windows 11/10 PC are as follows: The security identifier is corrupted. hung system

The Apple Vision Pro headset is not natively compatible with computers, so you must configure it to connect to a Windows computer. Since its launch, Apple Vision Pro has been a hit, and with its cutting-edge features and extensive operability, it's easy to see why. Although you can make some adjustments to it to suit your PC, and its functionality depends heavily on AppleOS, so its functionality will be limited. How do I connect AppleVisionPro to my computer? 1. Verify system requirements You need the latest version of Windows 11 (Custom PCs and Surface devices are not supported) Support 64-bit 2GHZ or faster fast processor High-performance GPU, most

Many users have been complaining about encountering error code caa90019 every time they try to log in using Microsoft Teams. Even though this is a convenient communication app, this mistake is very common. Fix Microsoft Teams Error: caa90019 In this case, the error message displayed by the system is: "Sorry, we are currently experiencing a problem." We have prepared a list of ultimate solutions that will help you resolve Microsoft Teams error caa90019. Preliminary steps Run as administrator Clear Microsoft Teams application cache Delete settings.json file Clear Microsoft from Credential Manager

Having issues with the Shazam app on iPhone? Shazam helps you find songs by listening to them. However, if Shazam isn't working properly or doesn't recognize the song, you'll have to troubleshoot it manually. Repairing the Shazam app won't take long. So, without wasting any more time, follow the steps below to resolve issues with Shazam app. Fix 1 – Disable Bold Text Feature Bold text on iPhone may be the reason why Shazam is not working properly. Step 1 – You can only do this from your iPhone settings. So, open it. Step 2 – Next, open the “Display & Brightness” settings there. Step 3 – If you find that “Bold Text” is enabled

Some PC users and gamers may experience abnormally high CPU usage when using Windows 11 or Windows 10, especially when running certain applications or games. This article provides some suggestions to help users alleviate this problem. Some affected PC users noted that when experiencing this issue, they observed Task Manager showing other applications using only 0% to 5% of the CPU, while the Service Host: Capability Access Manager service was seeing usage as high as 80%. % to 100%. What is the Service Host: Feature Access Manager service? The function of the Function Access Manager service is to confirm whether the application has permission to access the camera and microphone and grant the necessary permissions. It facilitates the management of UWP applications

This article will guide you on how to migrate photos from Photos Legacy to the new Photos app in Windows 11. Microsoft has introduced a revamped Photos app in Windows 11, giving users a simpler and more feature-rich experience. The new Photos app sorts photos differently than the past PhotosLegacy app. It organizes photos into folders like other Windows files instead of creating albums. However, users still using the Photos Legacy app can easily migrate their photos to the new version of Microsoft Photos. What is Phot
