I want to know how to change view on button click in iPhone without navigation controller?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
If you're doing this with a UIViewController, you would probably do this like following:
Not sure why you don't want to use a UINavigationController though. If it's the navigation bar at the top you don't want to see, there's a property for that so you can hide that bar. Not sure about it's name, probably navigationBarHidden or something like that. You can look that up in the API.
You can place two UIView variables in the header file and hide/show one of them or you can make another layer over the existing view like this:
Place this in Button IBAction method
Assume you have two view myView1 and myView2 and one button myUIButton in memory
There are many different ways you can do that, and you should possibly provide more information about your app.
A generic way to do it is the following, with animation:
In this case, both views are there, you only hide/show them as you need. Alternatively, you could add/remove the view from their superview: