【发布时间】:2011-04-20 21:04:20
【问题描述】:
我正在尝试在我正在构建的 iPhone 应用程序中使用垃圾桶动画。我知道我需要帮助的功能是私有 API,但该应用程序将在内部进行。
根据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 的一部分。看看这个答案:stackoverflow.com/questions/428110/…
-
谢谢。我知道它是一个私有 API,但我想在内部应用程序中使用它。我已经让吸吮动画工作了,但我需要帮助才能使用垃圾桶动画。有人可以解释一下它是如何使用的并举个例子吗?
标签: iphone animation bin recycle-bin