Sdphotobrowser. Demo
1, in the file sdbrowserimageview.m useful sdwebimage to the network load the picture needed to remove the comments can be
#import "ViewController.h"#import "SDPhotoBrowser.h"@interfaceViewcontroller () <SDPhotoBrowserDelegate>{Nsmutablearray*arrayimage;}@end@implementationViewcontroller- (void) viewdidload {[Super viewdidload]; [Self creatui]; }-(void) creatui{Arrayimage= [NsmutablearrayNew]; for(inti =0; i<9; i++) {Uiimageview* Imavi = [[Uiimageview alloc] Initwithframe:cgrectmake (i%3* -+ -, i/3* -+ -, the, the)]; Imavi.tag=i; Imavi.userinteractionenabled=YES; UITapGestureRecognizer* Tap =[[UITapGestureRecognizer alloc]init]; [Tap addtarget:self Action: @selector (tapaction:)]; [Imavi Addgesturerecognizer:tap]; Imavi.image= [UIImage imagenamed:[nsstring stringWithFormat:@"%d.jpg". II1]]; [Self.view Addsubview:imavi]; [Arrayimage addobject:[nsstring stringWithFormat:@"%d.jpg". II1]]; } }-(void) Tapaction: (uitapgesturerecognizer*) tap{UIView* VI =Tap.view; Sdphotobrowser* Broser =[[Sdphotobrowser alloc] init]; Broser.currentimageindex=Vi.tag; Broser.sourceimagescontainerview=Self.view; Broser.imagecount=Arrayimage.count; Broser.Delegate=Self ; [Broser show]; }////////////////////////////////////////////delegate//////////////////Iamge of the website//-(nsurl*) Photobrowser: (Sdphotobrowser *) browser Highqualityimageurlforindex: (nsinteger) index{//////nsstring *imagename = Arrayimage[index];//Nsurl *url = [[NSBundle mainbundle] Urlforresource:imagename Withextension:nil];//return URL;//}//The local image-(uiimage*) Photobrowser: (Sdphotobrowser *) Browser Placeholderimageforindex: (nsinteger) index{UIImage* ImageView =[UIImage Imagenamed:arrayimage[index]]; returnImageView;}
IOS Image browser Sdphotobrowser like a friend's circle