One.
Two, engineering drawings.
Three, code.
RootViewController.h
#import <UIKit/UIKit.h> @interface rootviewcontroller:uiviewcontroller<uiscrollviewdelegate>{ Uiscrollview *scoreview;} @end
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. [Self initbackgroundview];} #pragma-mark-functions-(void) initbackgroundview{Self.view.backgroundcolor=[uicolor Greencolor]; Scoreview=[[uiscrollview alloc]initwithframe:cgrectmake (0, 100, 320, 140)]; Scoreview.backgroundcolor=[uicolor Greencolor]; Scoreview.contentsize=cgsizemake (320*3, 140); Scoreview.showsverticalscrollindicator=no; Scoreview.showshorizontalscrollindicator=no; Scoreview.scrollenabled=no; scoreview.delegate=self; [Self.view Addsubview:scoreview]; for (int i=0; i<4; i++) {uiimageview* imageview=[[Uiimageview Alloc]initwithframe:cgrectmake (i*320, 0, 320, 140)]; Imageview.image=[uiimage imagenamed:[nsstring stringwithformat:@ "%d.jpg", I]]; if (i==3) {imageview.image=[uiimage imagenamed:@ "0.jpg"]; } [Scoreview Addsubview:imageview]; } [Nstimer scheduledtimerwithtimeinterval:1.0 target:self selector: @selector (timer:) Userinfo:nil Repeats:yes]; uipagecontrol* PC = [[Uipagecontrol alloc] Initwithframe:cgrectmake (0, 220, 320, 20)]; Pc.numberofpages = 3; pc.tag=100; [PC Addtarget:self action: @selector (PC:) forcontrolevents:uicontroleventtouchupinside]; [Self.view addsubview:pc]; }-(void) Timer: (Nstimer *) timer{if (scoreview.contentoffset.x==320*3) {scoreview.contentoffset=cgpointmake (0, 0 ); } [Scoreview Setcontentoffset:cgpointmake (scoreview.contentoffset.x+320,0) animated:yes];} -(void) PC: (uipagecontrol*) pc{scoreview.contentoffset=cgpointmake (pc.currentpage*320, 0);} #pragma-mark-uiscrollerviewdelegate-(void) Scrollviewdidscroll: (Uiscrollview *) scrollview{uipagecontrol* pc = (uipagecontrol*) [Self.view VIEWWITHTAG:100]; Pc.currentpage = scrollview.contentoffset.x/320; if (scoreview.contentoffset.x==320*3) {pc.currentpage=0; }}-(void) didreceivememorywarning{[Super didreceivememorywarning]; Dispose of any resources the can be recreated.}
"Code Notes" movies on the trailer, automatic scrolling