gpt4 book ai didi

ipad - 如何添加像iphone应用程序一样的删除效果?

转载 作者:行者123 更新时间:2023-12-04 11:55:13 25 4
gpt4 key购买 nike

我必须在我的 ipad 应用程序中提供删除缩略图动画,就像 iphone/ipad 应用程序删除效果一样。
任何 body 帮助我请附上 sample 照片enter image description here

如果您需要更多详细信息,请在评论中提及

最佳答案

我已使用 CGAffineTransformMakeRotation 完成此操作.不知道有没有其他更好的方法。但我所做的是我的逻辑,你可以照原样复制它,你只需要在该 View 的左上角添加一个删除按钮。在下面的代码中,我只是为缩略图或任何 View 设置动画,就像 iPad 在其主屏幕上所做的那样。一件事,您需要全局声明 int 方向。每次调用此方法时,都会设置方向 = 1;

    -(void)shakeToDelete:(UIView *)shakeMe
{

[UIView animateWithDuration:0.1 animations:^
{
shakeMe.transform = CGAffineTransformMakeRotation(0.05 * direction);
}
completion:^(BOOL finished)
{

direction = direction * -1;
[self shakeToDelete:shakeMe];
}];
}

///编辑
我试过这种方式,让它在我的示例屏幕上工作,如照片所示
enter image description here

关于ipad - 如何添加像iphone应用程序一样的删除效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14230171/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com