Miss no Sister (fifth day)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.