How to switch views by buttons on iPhone?

2019-06-05 01:42发布

I want to switch 3 views and let them switch from 1-2-3. The first view is to let users input name and password, the second view will show his information to let him confirm and the third view will show him a list of options so he can choose what to do next.

The problem is how to switch these views? If I use a navigation controll to switch views, how can I add textfield in it so users can input their infomation?

3条回答
趁早两清
2楼-- · 2019-06-05 01:51

Thanks for your answers and I find this isn't so complicated as I thought earlier. After a few attempts, I finally made it. I just use NavigationController to switch between UIViews.

Now I understand that navigation controller can swith not only from UITableView to UIView, but also from UIView to UIView. Using a UIView class, I can organize all the controls easily in IB.

查看更多
成全新的幸福
3楼-- · 2019-06-05 02:17

Check out Apple's sample TableViewSuite application for hints. You'll find more sample code at Apple's iPhone Developer site.

查看更多
兄弟一词,经得起流年.
4楼-- · 2019-06-05 02:17

You hate to write your code into

-(void)IBAction

set the button property by using connection Inspector set the button to touchesDown. After this the view which you want to see at the beginning. Make it's alpha value 1 and other view's alpha value should be 0. After filling all information when you will click on button. Make alpha value of first view should be 0 and the second view's alpha should be 1. Like that you can proceed

查看更多
登录 后发表回答