views:

113

answers:

1

Hi Forum

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!

A: 

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

Eiko
A classic case of «duh» - thanks for enlightening me :)
Urs