Click on the image to display a larger image
This is the big picture effect of the second interface
Idea: First create a second interface controller, I am using xib directly pull the control
First in the image loading interface set a temporary image to spare, the code below the Red section, _nextshowimage is used for temporary use, in the Jump page when the value is directly assigned to the past, you do not have to load the big picture page again, although the SD will have a cache, But the code is not so much, so I used this method of passing the value
//set up a picture[Self.imageview sd_setimagewithurl:[nsurl Urlwithstring:url] placeholderimage:nil options:0progress:^(Nsinteger receivedsize, Nsinteger expectedsize) {//Note to write a 1.0, just at the beginning did not write 1.0,/out is an integer, I said how the progress bar directly 0 to 1CGFloat progress =1.0* Receivedsize/expectedsize; Self.bgImage.hidden=NO; Self. Progressview.hidden=NO; Self. ProgressView.progressLabel.textColor=[Uicolor Whitecolor]; Self. Progressview.roundedcorners=3; Self. ProgressView.progressLabel.text= [NSString stringWithFormat:@"%.0f%%", progress* -]; [Self. Progressview setprogress:progress Animated:yes]; } Completed:^ (UIImage *image, Nserror *error, Sdimagecachetype cachetype, Nsurl *ImageURL) { //save it, and it will be uploaded to the next screen display. _nextshowimage = image; Self.bgImage.hidden=YES; Self. Progressview.hidden=YES; //To determine whether to hide a git small icon for GIFSelf.gifImage.hidden = [Self.talkModel.type isequaltostring:@"Image"]; //decide whether to show "Click to view full image" if(talkmodel.isbigpicture) {//Big PictureSelf.bigImageOutlet.hidden =NO; }Else{//non-large imageSelf.bigImageOutlet.hidden =YES; } }];
Save success and failure when using the prompt box to find that the time is too long, I use Svprogresshud, so manually modified, changed to show 1 seconds, the default seems to be 0.5-5 seconds, modified is this function, directly Ruturn 1 on the line.
+ (Nstimeinterval) displaydurationforstring: (nsstring*)string { return1 ;}
Miss no Sister (fifth day)