我想在我正在建設的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