1. Implement uiscrollviewdelegate
-(Uiview *) viewforzoominginscrollview :( uiscrollview *) scrollview {
Uiview * subview = [scrollview
Viewwithtag: 22];
Return subview;
}
-(Void) scrollviewdidendzooming :( uiscrollview *) scrollview withview :( uiview
*) View atscale :( float) scale {
}
Two functions;
Construct the corresponding View Control
Uiimage * image = [uiimage
Imagenamed: @ "1807.jpg"];
Uiscrollview * scrollview = [uiscrollview
Alloc]
Initwithframe: Self. View. bounds];
[Scrollview
Setcontentsize: image. Size];
Scrollview. Delegate =
Self;
Scrollview. minimumzoomscale =
0.2;
Scrollview. maximumzoomscale =
5.0;
Scrollview. backgroundcolor = [uicolor
Lightgraycolor];
[Self. View
Addsubview: scrollview];
[Scrollview
Release];
Uiimageview * imageview = [[uiimageview
Alloc] initwithimage: Image];
[Scrollview
Addsubview: imageview];
Imageview. Tag =
22;
[Imageview
Release];