IPhone trash can suck animation

I am trying to use garbage animation in an iPhone application that I am creating. I know that I need help, this is a private API, but the application will work.

According to the iPhoneDevWiki on the toolbar page, you can activate the trash by opening the animation using [UIToolbar animateToolbarItemIndex:duration:target:didFinishSelector:]; .

After countless hours trying to use this method, I could not get it to work. I changed it to the following: [toolbar animateToolbarItemIndex:1 duration:1.0 target:self didFinishSelector:@selector(done:)]; .

toolbar is the name of the UIToolbar that I created using CGRectMake .

My basket button image may be 1, as this is the second button.

I tried putting self and nil in target , but it does not work.

didFinishSelector just links to -(void)done:(id)sender; .

If I change animateToolbarItemIndex to something that does not exist, the console says that it does not exist. Any ideas what I'm wrong about?

+4
source share
1 answer

Trash animation works with an array of images, each with closing / opening the cover a little more. So you would do something like this:

 UIImageView* trashCan = [[UIImageView alloc] initWithFrame:self.view.frame]; trashCan.animationImages = [NSArray arrayWithObjects:UIIMAGES, nil]; trashCan.animationDuration = 1.00; trashCan.animationRepeatCount = 1; [trashCan startAnimating]; [self.view addSubview:trashCan]; 

If you have Google, I’m sure you can find the cart images to use.

0
source

All Articles