The implementation of "code note" book-Flipping effect

Source: Internet
Author: User

Code:

Rootviewcontroller.m

#import "RootViewController.h" @interface Rootviewcontroller () @end @implementation rootviewcontroller-(ID) Initwithnibname: (NSString *) Nibnameornil Bundle: (NSBundle *) nibbundleornil{self = [Super Initwithnibname:    Nibnameornil Bundle:nibbundleornil]; if (self) {//Custom initialization} return to self;}    -(void) viewdidload{[Super Viewdidload];        Do any additional setup after loading the view. Initialize the background map [self initbackgroundview];}    #pragma-mark-functions-(void) initbackgroundview{[email protected] "The realization of the effect of book-flipping";        Self.view.backgroundcolor=[uicolor Redcolor];    UpButton UIButton *upbutton = [UIButton buttonwithtype:uibuttontypecustom];    Upbutton.frame = CGRectMake (20, 420, 50, 26);    Upbutton.backgroundcolor=[uicolor Bluecolor];    [UpButton settitle:@ "up" forstate:uicontrolstatenormal];    [UpButton addtarget:self Action: @selector (Doclickupbutton) forcontrolevents:uicontroleventtouchupinside];        [Self.view Addsubview:upbutton]; //downbutton UIButton *downbutton = [UIButton buttonwithtype:uibuttontypecustom];    Downbutton.frame = CGRectMake (250, 420, 50, 26);    Downbutton.backgroundcolor=[uicolor Bluecolor];    [DownButton settitle:@ "Down" forstate:uicontrolstatenormal];    [DownButton addtarget:self Action: @selector (Doclickdownbutton) forcontrolevents:uicontroleventtouchupinside]; [Self.view Addsubview:downbutton];}    #pragma-mark-doclickaction-(void) doclickupbutton{[UIView Beginanimations:nil Context:nil];    [UIView setanimationduration:0.7];    [UIView Setanimationtransition:uiviewanimationtransitioncurldown ForView:self.view Cache:yes]; [UIView commitanimations];}    -(void) doclickdownbutton{[UIView Beginanimations:nil Context:nil];    [UIView setanimationduration:0.7];    [UIView Setanimationtransition:uiviewanimationtransitioncurlup ForView:self.view Cache:yes]; [UIView commitanimations];}    -(void) didreceivememorywarning{[Super didreceivememorywarning]; Dispose of any resourcesThat can is recreated.} @end

  

The implementation of "code note" book-Flipping effect

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.