iPhone垃圾桶可以吸动画
我试图在我正在构建的iPhone应用程序中使用垃圾桶动画。我知道我需要帮助的功能是一个私人API,但该应用程序将是内部的 根据,您可以使用iPhone垃圾桶可以吸动画,iphone,animation,bin,recycle-bin,Iphone,Animation,Bin,Recycle Bin,我试图在我正在构建的iPhone应用程序中使用垃圾桶动画。我知道我需要帮助的功能是一个私人API,但该应用程序将是内部的 根据,您可以使用[UIToolbar animateToolbarItemIndex:duration:target:didFinishSelector:]激活垃圾桶打开动画 经过无数个小时的尝试,我无法使用这种方法。到目前为止,我已将其更改为:[工具栏动画ToolBarItemIndex:1持续时间:1.0目标:self-didFinishSelector:@selecto
[UIToolbar animateToolbarItemIndex:duration:target:didFinishSelector:]激活垃圾桶打开动画代码>
经过无数个小时的尝试,我无法使用这种方法。到目前为止,我已将其更改为:[工具栏动画ToolBarItemIndex:1持续时间:1.0目标:self-didFinishSelector:@selector(完成:)]代码>
toolbar
是我使用CGRectMake
编程创建的UIToolbar
的名称
我的垃圾桶按钮图像是1,因为它是第二个按钮
我曾尝试将self
和nil
放在target
中,但没有效果
didFinishSelector
仅链接到-(void)done:(id)发送方代码>
如果我将animateToolbarItemIndex
更改为不存在的内容,控制台会说它不存在。对我的错误有什么想法吗?垃圾桶动画使用一组图像,每个图像的盖子都稍微关闭/打开。所以你会这样做:
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];
如果你有一个谷歌,我肯定你能找到垃圾桶图片使用。animateToolbarItemIndex似乎不是公共API的一部分。看看这个答案:谢谢。我知道这是一个私人API,但我想在内部应用程序中使用它。我已经得到了吮吸动画工作,但我需要的垃圾桶动画的使用帮助。有人能解释一下它是如何使用的,并举个例子吗?