How to switch views by buttons on iPhone?

笑着哭i 提交于 2019-12-23 03:32:25

问题


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?


回答1:


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.




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/584892/how-to-switch-views-by-buttons-on-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!