I am going to add 5 buttons to scrollview ,in that scrollview when i am scrolling that scrollview has to scroll roundly, after end of fitth button again first button has to come to picture.
thanks..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have actually writen a blog post about this. Check out:
http://blog.touch4apps.com/home/iphone-monotouch-development/monotouch-infinite-loop-image-scroll-view
I found out that it can be possible to do with a simple tweak to UIScrollView, handing the
scrollViewDidEndDecelerating from the UIScrollViewDelegate.
Guys from Monotouch team made the great job on this (as usual) and we have the delegate already available via built-in events, in this case DecelerationEnded.
So lets have a look at the implementation of the UIViewController class of some view, note we are adding the UI from the code, not from the nib file, just for simplicity. View has UIScrollView item and loads some images, last image is placed as the first one, then all images in the order and then first image as the last one.
Then the event for DecelerationEnded is handled to actually swap the position (fast – no animation) so user does not find out. For added more touch, the paging is enabled and of course the scroller is hidden, so it is not visible to the user where in the scrolling position he actually is.
public partial class ImageScrollViewController : UIViewController
{
#region Constructors
That is actually all there is to it. And github link: http://github.com/sichy/ImageScrollView
Happy coding!