Reputation: 11
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!
Upvotes: 1
Views: 1303
Reputation: 25632
You could pass a rect with the size of your scroll view's visible area, centered around the button's center.
Upvotes: 5