iphone - Slideshow of Images -
i developing application of simple slideshow.
description : in application i've 5 images stored in array.currently i'm displaying images scroll view want show slideshow of images stored in array. how can ? tutorials ?
regards
i'd suggest using nstimer, here's basic code. "page" number has calculated somewhere, according how you'd handle edge cases, example: last image in slide show.
have @ apple's example app pagecontrol, shows nice way how handle memory efficiently in paging scrollview.
self.slidetimer = [nstimer scheduledtimerwithtimeinterval:3.0 target:self selector:@selector(slide) userinfo:nil repeats:yes]; ... - (void)slide { cgrect frame = scrollview.frame; frame.origin.x = frame.size.width * nextimagepagenumber; frame.origin.y = 0; [scrollview scrollrecttovisible:frame animated:yes]; }
you use nstimer class create timer objects or, more simply, timers. timer waits until time interval has elapsed , fires, sending specified message target object. example, create nstimer object sends message window, telling update after time interval.
Comments
Post a Comment