简体   繁体   English

如何使用Objective-C创建iPhone ios4文件夹效果

[英]How to create iPhone ios4 folder effect with objective-c

anyone can give me any hint to recreate the iPhone ios4 folder effect? 任何人都可以给我任何提示来重新创建iPhone ios4文件夹效果吗? I'd like to implement that in my iPhone App. 我想在我的iPhone App中实现它。 Thanks 谢谢

Hmmm -- Off the top of my head (not at all final/fully developed idea): 嗯-不在我的头上(根本不是最终/完全发展的想法):

You have a few options here to handle the interactions - but first off you will need to look at CATransforms and UIView Animations - they will be essential in animating the scaling and translating of your views. 您可以在此处选择一些选项来处理交互-但是首先,您需要查看CATransforms和UIView动画-它们对于动画化视图的缩放和平移至关重要。

With the interactions, might I suggest using UIGestureRecognizers - they provide a great base of interaction (singleTouch, doubleFingerTouch, Tap, Pan, Pinch, swipe, Rotate etc) - you can set number of touches/taps required as well. 对于交互,我可能建议使用UIGestureRecognizers-它们提供了很好的交互基础(singleTouch,doubleFingerTouch,Tap,Pan,Pinch,Swipe,Rotate等)-您还可以设置所需的触摸/轻击次数。

The general setup would be to apply a pan recognizer to your views - then possibly have a timer that counts how long a view has been hovered over another - or have a certain region where a pan actives on another view. 一般设置是将平移识别器应用于您的视图-然后可能有一个计时器来计数视图在另一个视图上的悬停时间-或在某个区域中某个平移在另一个视图上处于活动状态。 Then you would animate a UIView to replicate the opening of the folder (tell the view to scale vertically or similar), add the subviews (title field, current objects inside the folder etc) -- then when you release the view being panned you would animate it to scale down into the folder. 然后,可以对UIView设置动画,以复制文件夹的打开(告诉视图垂直缩放或类似缩放),添加子视图(标题字段,文件夹内的当前对象等),然后释放被平移的视图时,对其进行动画处理以缩小到文件夹中。

A nice idea would be to store folder information using CoreData too (then you can easily re-load folders and alter them etc). 一个不错的主意是也可以使用CoreData存储文件夹信息(然后您可以轻松地重新加载文件夹并对其进行更改等)。

Just an idea, 只是一个主意

Feel free to ask specific questions about animating views - I have been working in the area a fair bit in the recent weeks. 随意问有关动画观点的具体问题-最近几周我一直在这一领域工作。

Best regards, 最好的祝福,

Michael 麦可

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM