iOS
iOS

Reputation: 3616

Zoom UIView and all the contents in it

I am new to develop iOS frameworks/library. I have to develop a framework to zoom the pages of an iOS application. I have a view based application and some elements like UIButton and UITextField in it. When I do a pinch zoom/double tap, the UIView and all its contents should be zoomed(pan and zoom) accordingly.

My idea is to create a template view, which acts as a normal UIView(I mean that I can add components and sub views to the view), which has the feature to pan and zoom. Please note that all its components(UIButton, UITextField) are also zoomed accordingly.

First of all I'd like to know whether it is possible. Please do give me some suggestions to achieve it.

Upvotes: 0

Views: 654

Answers (1)

pradeepa
pradeepa

Reputation: 4164

Use Scrollviews delegate to return the view to be zoomed

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
    return viewTobeZoomed;
}

Also u can control the max and min zoom values as

    self.scrollView.minimumZoomScale=1.01;
    self.scrollView.maximumZoomScale=5;
    self.scrollView.zoomScale=1.01;

Upvotes: 2

Related Questions