Saturday 15 March 2014

iphone - IOS Scrollview Marquee style -


I have a set of 4 images, which I want to show in UIScrollView . There are advertising banners in this scroll view, so they need to scroll equally as a circle effect - the user does not need to scroll the screen. This process should be repeated.

If the user touches the screen, the scrolling should be stopped & amp; When the user touches the screen again, the scrolling should restart from where it was left.

Simple way, I think you can help. Follow these steps:

1) Add 4 UIImageView s vertical bottom.

2) Create 4 different arrays for these images. NSArray * frames1 = [NSArray arrayWithObjects: [UIImage imageWithName: @ "a.png"], [UIImage imageWithName: @ "B.png"], [UIImage imageWithName: @ "C.png"], [UIImage imageWithName: @ "d.png"], zero]; NSArray * Frame2 = [NSArray arrayWithObjects: [UIImage imageWithName: @ "b.png"], [UIImage imageWithName: @ "c.png"], [UIImage imageWithName: @ "d.png"], [UIImage imageWithName: @ "A.png"], zero]; NSArray * frame3 = [NSArray arrayWithObjects: [UIImage imageWithName: @ "c.png"], [UIImage imageWithName: @ "d.png"], [UIImage imageWithName: @ "a.png"], [UIImage imageWithName: @ "B.png"], zero]; NSArray * frames4 = [NSArray arrayWithObjects: [UIImage imageWithName: @ "d.png"], [UIImage imageWithName: @ "a.png"], [UIImage imageWithName: @ "b.png"], [UIImage imageWithName: @ " C.png "], zero];

3) Provide these arrays to all these different image views.

  yourImageView1.animationImages = frames1; YourImageView2.animationImages = frames2; YourImageView3.animationImages = frames3; YourImageView4.animationImages = frames4;   

4) You can also add some effects ...

  // All frames will run in 1.75 seconds. Duration = 1.75; // Repeat your image view again. Animation recurrence = 0;   

5) Just type startAnimating image view.

  [yourImageView1 startAnimating]; [YourImageView2 Startup Permission]; [YourImageView3 Startup Permission]; [YourImageView4 Startup Permission];   

6) You can always use the -touchchesEnded method to turn the animation on and off.

  - (zero) Touch-ended: (NSSET *) touches the event: (UIEvent *) event {if ([[touches the object]] == Ijes 1) {// Here you can write code to close the UIIM ve and start the animation}}   

I think the effect you want with this will give you .

Good look !!!

No comments:

Post a Comment