Reputation: 727
I'm trying to get the effect showed in the image below:
The blue box is supposed to be the UIScrollView
. Once you launch the application what you see is button 1 and 2, but I want that when the user pushes button 1 for example, the scroll view moves horizontally to the left and shows Text Field 1 and 2 in the same position where the buttons were.
I guess the UIScrollView
is the best way to do it and then implement in one of the buttons the code to make that transition (using Core Graphics?). If you have any better idea or a link with a tutorial with same effect would be great.
Thank you in advance!
Upvotes: 0
Views: 121
Reputation: 1107
A simple way to do it (mostly) with Storyboard:
Make a UIView which will act as container for your buttons and textfields with 640 width
Make sure the view is at positioned at x: 0 then add the buttons, now make x: -320 and add the textFields
Next link the container view to your code by ctrl+dragging it and name it (mine bottomMenuView
)
Now cntr+drag from your button1
to your .M code for an IBAction
(mine button1Method)
And finally move the x coordinate to reposition the container view with this method body
Upvotes: 1