How to Image scroll in Horizontally after click on next button in iOS -
in application want create image gallery. used repagedscrollview. able scroll image on scrolling. i'm unable change image when click on next , previous button. how achieve functionality? multiple image change after scrolling, work perfectly. tried below code change image after click on next button.
- (void)viewdidload { [super viewdidload]; scrollview = [[repagedscrollview alloc] initwithframe:self.slider_view.bounds]; scrollview.delegate=self; } - (void)scrollviewdidscroll:(uiscrollview *)scrollview1 { if(scrollview1.tag ==0){ cgfloat pagewidth = scrollview1.frame.size.width; current_page = floor((scrollview1.contentoffset.x - pagewidth / 2.0) / pagewidth) + 1; self.index_lbl.text = [nsstring stringwithformat:@"%d of %lu",current_page+1,(unsigned long)[self.seletedfile count]]; } } -(ibaction)nextbtn:(id)sender { }
in next button method do:
[scrollview scrolltopagewithindex:current_page + 1 animated:yes];
Comments
Post a Comment