iPad UI 版 Twitter - 它是如何工作的?
iPad 版 Twitter 引入了一种新的内容浏览方式。有人猜测这些滑动面板是如何管理的吗?它是一个很大的UIScrollView
,里面有一堆UITableViews
吗?或者一堆 UIViewControllers
在彼此之上滑动?还是别的什么?你的赌注是什么?
Twitter for iPad introduced a new way of browsing content. Does anyone have a guess of how these sliding panels are managed? Is it one big UIScrollView
with a bunch of UITableViews
in it? Or a bunch of UIViewControllers
sliding on top of each other? Or something else? What's your bet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我认为这里的技巧不在于使用的视图类型,而在于它们的定位和动画。当各种面板滑入和滑出时,我认为它们正在使用类似 CAKeyframeAnimations 之类的东西,这些动画通过 UIGestureRecognizer 的实现来激活。
对于垂直滚动,他们使用 UIScrollView,但对于水平滚动,以上是我的赌注。
I think the trick here isn't in the view types used, but rather in the positioning and animating of them. When various panels slide in and out, I think they're using something like some CAKeyframeAnimations that activate through an implementation of UIGestureRecognizer.
For vertical scrolling they're using UIScrollView, but for horizontal scrolling, the above is my bet.
使用我在 GitHub 上的项目 FRLayeredNavigationController,您可以轻松开发与 Twitter iPad 应用程序非常相似的 UI。还有一篇关于它的博客文章。
如果您对它的工作原理感兴趣,只需查看代码即可,它是开源的;-)。基本上它使用 iOS 5 中引入的
UIViewController
组合。它管理多个“层”,这些“层”是您提供的UIViewController
。图层的移动由 UIPanGestureRecognizer 和何时移动哪个图层的一些逻辑触发。由于良好的 iOS 动画支持,它看起来和感觉都非常好。FRLayeredNavigationController
的 API 与UINavigationController
非常相似,因此很容易使用:-)。 使用 FRLayeredNavigationController:来自我的 EuroCopaInfo 项目的示例,该项目 com/weissi/EuroCopaInfo/blob/master/EuroCopaInfo/StadiumsViewController.m" rel="nofollow">
StadiumsViewController.m
:来自
AppDelegate.m
:另请观看演示视频/屏幕截图:
Using my project FRLayeredNavigationController on GitHub you can easily develop UIs very similar to the Twitter iPad app. There's also a blog post about it.
If you're interested how it works, just look at the code, it's open sourced ;-). Basically it uses
UIViewController
composition as introduced in iOS 5. It manages multiple "Layers" which areUIViewController
s you provide. The moving of the layers is triggered by aUIPanGestureRecognizer
and some logic when to move which layer. It looks and feels very nice because of the nice iOS animation support.FRLayeredNavigationController
's API is quite similar toUINavigationController
, so it's easy to use :-). Samples from my EuroCopaInfo project, which uses FRLayeredNavigationController:In file
StadiumsViewController.m
:From
AppDelegate.m
:Also watch the demo videos/screenshots:
这是为 ipad 应用程序获取类似 Twitter 的 UI 的好例子。
查看此链接,它真的很棒!!!!
它提供:
Here is the good example of getting twitter-like UI for ipad app.
Check this link, its really awesome!!!!!
It provides :
我的猜测:这是一个用于水平移动的 UIScrollView,主视图后面的 UIView 是手动动画的,具体取决于主视图的位置。
UIScrollViewDelegate
提供了许多为背景UIView
设置动画所需的方法。My guess: It's a
UIScrollView
for the horizontal movement, with theUIView
s behind the main view being animated by hand, depending on where the main view is. TheUIScrollViewDelegate
provides a lot of the methods necessary to animate the backgroundUIView
s.据称,开发人员将导航控制器扁平化为可滑动面板。但据我所知,尚无其他信息。
原始推文
这有点道理,它基本上只是一个
UINavigationController
和您在堆栈中上下移动的方式会发生变化。现在可以显示多个,而不是一次仅显示 1 个 UIViewController。不过,我无法真正帮助具体实施。Supposedly the developer flattened a navigation controller into slidable panels. Yet no other info is known to my knowledge.
Original tweet
It kind of makes sense, it's basically just a
UINavigationController
and the way you move up and down the stack changes. Instead of showing just 1UIViewController
at a time, now multiple can be shown. I can't really help with the exact implementation though.