Search code examples
iphoneobjective-ciosxcodeuitoolbar

Has anyone created a vertical UIToolBar? Or some sort of vertical menu with UIButtons?


I am trying to created a vertical menu (on the left side of the screen) which I can display and hide using a gesture recognizer.

I have found a post similar to this which helped slightly, but all it did was rotate the UIToolBar to a vertical position without changing the width or position.

If anyone has succesfully created something similar to this and is willing to help I would greatly appreciate it!

Also, if anyone can point me in the right direction possibly to some sample code I would like that as well.


Solution

  • You could do this with a UIToolBar by applying a 90 degree rotation transform, and then having all your icons rotated 90 degrees to match - you can change the width and position simply by adjusting the UIToolBar frame. However, you will need to create your own toolbar to do this rather than using the built-in one you get with a navigation controller.

    Another option is simply to roll it yourself: this will allow you more customisation, so is perhaps the better option. There are a number of third-party implementations of varying types, some based off the current Facebook App side-bar, a good place to start looking is http://cocoacontrols.com - they are of varying quality.

    On the other hand, it wouldn't be too difficult to roll your own, so that's a good option to consider.