我想在我正在建设的iPhone应用程序中使用垃圾桶动画。我知道我需要帮助的功能是一个私人API,但该应用程序将是内部的。iPhone垃圾桶吸动画
按照iPhoneDevWiki at the toolbar page可以激活垃圾桶使用[UIToolbar animateToolbarItemIndex:duration:target:didFinishSelector:];
开场动画。
无数个小时试图用这种方法我无法得到它的工作之后。我已经将其更改为以下内容:[toolbar animateToolbarItemIndex:1 duration:1.0 target:self didFinishSelector:@selector(done:)];
。
toolbar
是我编程使用CGRectMake
创建的UIToolbar
的名称。
我对垃圾桶按钮图像是1,因为它是第二个按钮。
我试过把self
和nil
放在target
但它不起作用。
didFinishSelector
只是链接到-(void)done:(id)sender;
。
如果我改变animateToolbarItemIndex
的东西不存在,控制台说,它不存在。任何想法,我有什么错?
animateToolbarItemIndex并不似乎是公共API的一部分。看看这个答案:http://stackoverflow.com/questions/428110/how-can-i-replicate-the-trashing-animation-of-mail-app – mharper 2011-04-20 21:55:09
谢谢。我知道这是一个私人API,但我想在一个内部应用程序中使用它。我已经有了吸引动画的工作,但我需要使用垃圾桶动画的帮助。有人可以解释它是如何使用和一个例子吗? – baharini 2011-04-21 06:27:05