Is there some way to prevent iCarousel from scrolling? Like, a "lock screen" feature? When i press a button, it should stop scrolling and when the button is pressed a second time, it'll start scrolling again. Is there any way to do this?
4 Answers
3
votes
1
votes
If you just want to prevent the user from interacting with the carousel then simply write
[carousel setUserInteractionEnabled:NO];
To start scrolling then the first button is pressed write:
-(IBAction) spinButton:(id)sender {
[carousel scrollByNumberOfItems:30 duration:10];
}
To stop scrolling then the second button is pressed write:
-(IBAction) stopButton:(id)sender {
[carousel scrollToItemAtIndex:[carousel currentItemIndex] animated:YES];
}