0

I would like to have buttons inside a scroll view (or another solution to creating a scrollable button bar).

I have buttons placed side by side in a row along the top of a view. As a user resizes the window to be less wide, fewer buttons can be seen.

When all the buttons cannot be viewed, I would like the user to still be able to access all the buttons by scrolling horizontally through them.

To visualise this, imagine in Safari if you open too many tabs to fit in the window - I would like the user to be able to scroll to the right and reveal the tabs that weren't on the screen.

A A
  • 147
  • 1
  • 2
  • 8
  • So what's the question? Just embed the buttons in a scroll view. – rdelmar May 27 '12 at 23:49
  • That's just what I tried. In IB, I embedded buttons in a scroll view but when I resize the window, the scroll view simply covers up the buttons and the scroll bar doesn't appear. One of the ways I've tried this is, in IB, 1.I drag buttons into a window/view, 2.I select all buttons, 3.from the menu bar I choose Layout>Embed Objects In>Scroll View, 4.in the Inspector I change the Autosizing property of the scrollview and the custom view in the scroll view (perhaps I am not making the right changes-I've tried a few different ways). – A A May 28 '12 at 12:02

1 Answers1

0

You need to deselect the springs (for the custom view of the scroller) in the autosizing setter so that the view doesn't shrink along with the scroll view when you resize.

rdelmar
  • 103,982
  • 12
  • 207
  • 218