1

I have a uiscrollview with tons of buttons in it. What I need to do is show one of these buttons at the center of the screen.

When I use scrollRectToVisible (passing the button-frame), the scrollview indeed shows the button - but sometimes at the top-left corner, sometimes at the bottom right corner - apparently depending on when the button hits the visible area of the scrollview.

But - as mentionend - I need the button to appear in the center of the screen.

Any hints on how to achieve that?

Thanks for any help!

Urs
  • 11
  • 2

1 Answers1

5

You could pass a rect with the size of your scroll view's visible area, centered around the button's center.

Eiko
  • 25,601
  • 15
  • 56
  • 71