0

i want to build a scrolled-menu uicomponent like the image given below.could u guys help me which is the best place to start.Am i supposed to use a toolbar with button embedded with scroll? any help is much appreciated.. enter image description here

kingston
  • 1,553
  • 4
  • 22
  • 42

1 Answers1

1

I would use a UIScrollView with your buttons as subviews. Forget about using UIToolbar because that would make things very complicated (You can use an image to imitate the appearance of the toolbar).

Just make a UIScrollView, add your buttons as subviews, and remember to set the contentSize according with the number of buttons you have (numButtons*buttonWidth).

That's my approach, but maybe there's another good/elegant solution.

Here you'll find a PSD that will help imitating the toolbar.

Youssef
  • 3,582
  • 1
  • 21
  • 28
  • thanks man..i ve created an view controller using uiscrollview with buttons ..everything works fine the problem is if i m to click one of the button its takes me to a next view..wat i want is that the scroll bar to be fixed and the change of view got to get affected below the scrollview on the click of the corresponding buttons..any idea – kingston Sep 28 '11 at 14:20
  • You can do that in different ways. You can use a scrollview that contains all the views that the user can navigate, and when the user push a button scroll it to the associated view. Another approach is adding and removing the views whenever the user push a button – Youssef Sep 28 '11 at 14:24
  • Sorry, I don't have any sample here but look at [this answer](http://stackoverflow.com/questions/4977283/uiscrollview-with-multiple-uiviewcontrollers/4977296#4977296) and [this](http://stackoverflow.com/questions/1990658/how-do-i-put-viewcontrollers-into-a-uiscrollview/1990847#1990847) They cover what you need – Youssef Sep 28 '11 at 14:31