Search code examples
iphoneuiviewxcode4ios4uiscrollview

How can impliment zoomIn a uiscrollview in a uibutton event


I am new in ios development.Now , i am trying to implement an application with uiscroll view.In my scroll view has a uiview and the uiview have many uibutton, that are arranged as row and column manner.After the button arrangement the size of uiview exceed the frame size of Iphone. My need is to Zoom In the scrollview and the size become the ipone frame size (0,0,320,460) with out avoid any part of uiview.The zoom in operation is under a uibarbuttonitem event. How can do this Zoom In?

If any body know ,please clear my question. Thanks in advance.

This is the screen shot (the uibuttons are UIButtonTypeCustom)

This is the screen shot of uiview


Solution

  • Following code might help you-

    //set zoom
    UIScrollView *scrollView = .........
    [scrollView setZoomScale:2.0 animated:YES];
    

    You can set zoom scale as per your need.