3

i'm quite new to ios development and i'm wondering if there is such a "drop down menu" as you see in the following picture:

pic1

when you touch it, it smoothly comes down and returns up after another touch. additionally, there is a horizontal scroll view included where you can choose different items...

whats the best approach to get startet with something like this? examples, tutorials, i'm happy with all :-)

thx

Community
  • 1
  • 1
user944351
  • 1,213
  • 2
  • 19
  • 27
  • 1
    No, there is no such drop down menu, you have to make it yourself. The basic approach is quite easy, I did this myself quite a number of times. Do you know how to work with views and animation? I'd recommend you some links, but I need to have an idea about your level :D – BBog Feb 29 '12 at 08:35
  • Ok i see.. I don't know how to work with animations yet. I'm new to iOS but i came from Android so it can't be so difficult i think ;-). Can you give me an example/links? Thx – user944351 Feb 29 '12 at 08:56

1 Answers1

2

So, here's the basic idea: you make a view that acts like the one in your example. The horizontal scroll view could be achieved more easily with a rotated table ( http://iosstuff.wordpress.com/2011/06/29/creating-pulse-style-scrolling-horizontally-scrolling-uitableview-as-a-subview-of-uitableviewcell/ )

And here's how I usually do it: after designing and making this view work just like I want to, I change its origin from the Interface Builder. For example, I have a view with the frame (0, 0, 320, 200), a standard iphone view with a 200 pixels height, starting from the top of the visible view. I then change its origin to (0, -200, 320, 200) Now the view is still there, but it's not visible the first time.

The next step would be to add a button, and when you press the button, the view becomes visible/invisible, or maybe a gesture detector, to make it show when you swipe ( How to detect Swipe Gesture in iPhone SDK? ).

Finally, you animate the view ( http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial ) so when you want it to become visible, its frame changes back to (0, 0, 320, 200), or again (0, -200, 320, 200) when you want to hide it.

Of course, it's not necessary to change the whole frame, you can also change the view's center if you find it easier.

That would be all! I hope this will help you

Community
  • 1
  • 1
BBog
  • 3,630
  • 5
  • 33
  • 64
  • isn't the rotated table a little overkill for that what i need? looks quite difficult... – user944351 Feb 29 '12 at 10:45
  • the rotated table is only for the horizontal scrolling part :D To simply use the hide/show view part, you don't need it at all – BBog Feb 29 '12 at 11:55