Search code examples
iphonexcodeanimationuiscrollviewscale

xcode iphone scrollview scale


What I want to do is an horizontal scroll view with buttons inside and when A button came at the center of the screen it became bigger. How can I do this?


Solution

  • Intercept the delegate method for scrollViewDidScroll: and monitor the scrollviews contentOffset. Doing so will allow you to make any adjustments each time the scrollview moves. As your button.center moves closer to your scrollviews center, increase its frame.size. Be sure not to do anything overly complex in scrollViewDidScroll bc it will be called a lot.