[Address Book Case-Login Function-Segue Objective-C Language]
Mobile
2024-01-08 22:39:14
views: null
1. Let’s talk about the implementation of the login button next.
1. Let’s implement a function of this login button.
For example, when I click "Login", I want to jump to the TableView at the back.
First, let’s take a look at the sample program for reference.
When our two text boxes above have values,
When both text boxes have values, the login button will light up.
When I click the "Login" button, I should jump to the controller at the back.
Okay, so what should we do at this time?
2. First, I need a controller. Let’s drag this controller out first.
Before dragging the controller, let's take a look at our sample program.
When I log in, a "Logging in" prompt message is displayed first.
Then, show another controller,
This is a TableViewController, right?
So, I drag another UITableViewController from behind.
After dragging it,
We now click the "Login" button and jump over.
Should we get connected?
Let's unplug it first,
Select "show",
For this connection, I should choose "show", right?
So, below, there is an expired push.
Have you told everyone this? No, please tell everyone.
2.The difference between push and show
1) Actually, you choose push now, this time, command + R,
There is no problem with this. The code is not expired, but the storyboard is expired.
Okay, then, in this, I enter "1" in both text boxes.
I now, let the "Login" button light up and then click,
It can also be jumped over,
You select "show", in fact, it can also be skipped,
So, these two, "push", and "show",
What's the difference?
Here I am, inside this, delete it first,
delete,
Then, drag in a Controller casually.
Okay, let’s use show to connect it first.
Let's first, say, select "show",
Well, when selecting show, sometimes we may need to change the title of the controller behind you.
So, what we just changed can be changed by double-clicking it.
Now, can't I change it by double-clicking it?
So what is the shortcoming at this time?
Do you want to drag something called "Navigation Item"?
Search for "navi"
Okay, come on, inside here,
Inside this, let's take a look. Inside this, tableViewController, there is only one table View.
2) At this time, I want to drag a Navigation Item and bring it up.
Hey, I can’t go up, oh, it’s the one on the right, ah,
Okay, drag this "Navigation Item" up,
Then, drag this thing up,
After dragging it up,
Now it's not just a table view,
There is also something called "Navigation Item",
Then, here we can double-click to change the title.
You can change its title.
Then, command + R,
Now, I also let it light up, and then click the "Login" button.
It should display this title,
"·12312312", it also pushes from right to left.
Then, there will be a title of "·12312312",
3. Okay, so, what is the difference between push and show?
1) Now, I delete the previous Controller and drag another table View Controller.
Then, connect a line to the login button,
Select "push",
2) After selecting push, look here on the left.
Look here on the left, there is a Navigation Item, right?
After you choose push, is it equivalent to having this Navigation Item by default?
You can also change the title,
command + R,
I make the login button light up, click the login button,
Click the login button,
Is there a title above?
In other words, the difference between push and show is, in fact,
1) push: It will automatically add the previous Navigation Item to you.
Origin blog.csdn.net/madoca/article/details/135270691