iOS:Facebook聊天头像的行为和动画 [英] iOS: Facebook chat heads behaviour and animations

查看:167
本文介绍了iOS:Facebook聊天头像的行为和动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题可能已经过时了,但是我一直在使用新的iOS版iOS,聊天头功能(聊天头只在应用程序中),并且想知道Facebook如何去实现这个例如。他们如何处理聊天头的拖动动画,以及(点击聊天头部)时,他们是如何设计在背景中的基本UIViews之上叠加UITableView?

This question is probably a little out of date, but I've been using the new Facebook for iOS with the "chat heads" feature (with the chat heads only present within the app), and was wondering how Facebook went about implementing this? E.g. How did they handle the drag animations for the chat heads, and also (when clicking on the chat head) how did they manage to overlay a UITableView on top of the "base" UIViews in the background?

这是UIKit的所有部分,还是创建自己的类来处理?

Is this all part of UIKit, or did they create their own classes to handle this?

推荐答案

在评论中回答@ StuartM的问题,在过去的几个月里,我对UIKit有更多的经验,我想我有一个大概的想法,我将如何执行这样的事情,如果我要这样做。

To answer @StuartM's question in the comments, in the last couple of months I've had a bit more experience with UIKit, and I think I have a rough idea on how I would implement something like this if I was going to do it.

我会做的是聊天头,创建一个风格的UIButton,并将其添加为主窗口的子视图。为了拖动,我将添加一个手势识别器到UIButton来回应拖动,对于抓住边缘,我会使用iOS 7的新UIKit动态( http://www.raywenderlich.com/50197/uikit-dynamics-tutorial )。

What I would do is for the chat head, create a styled UIButton and add it as subview to the main Window. For the dragging, I would add a Gesture Recognizer to the UIButton to respond to the drags, and for the "snapping to edges" I would use iOS 7's new UIKit Dynamics (http://www.raywenderlich.com/50197/uikit-dynamics-tutorial).

为了显示具有聊天记录的UITableView叠加层,我将使用一个Child View Controller( https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS /CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html#//apple_ref/doc/uid/TP40007457-CH18-SW6 ),而对于弹出的打开动画,我只是使用默认的UIView动画,也许使用动画交易,因为我是不知道我可以用隐含的动画做什么吗?

As for showing the UITableView overlay with the chat history, I would use a Child View Controller (https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html#//apple_ref/doc/uid/TP40007457-CH18-SW6) and as for the popping open animation, I would just use the default UIView animations, maybe using animation transactions as I'm not sure I can do everything with just the implicit animations?

我认为应该是这样。说实话,我认为任何一个处理这些框架的人都应该能够在iOS应用程序中构建任何东西,如果你在业余时间创建一个像聊天头像样的项目,应该给你一个很深的印象了解这些框架如何工作。

And I think that should be it. To be honest, I think anyone who has a handle on those frameworks should be able to build anything in their iOS apps, and if you were to create a "chat heads" like sample project in your spare time, should give you a pretty indepth knowledge of how those frameworks work.

这篇关于iOS:Facebook聊天头像的行为和动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆