本文介绍了iOS版本的Twitter个人资料屏幕是如何构建的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Twitter如何实现它的个人资料屏幕.起初,我认为这是一个带有标题(配置文件信息)和节标题(用于选择推文/媒体/收藏夹的分段控件)的表格视图.这对我来说很有意义,因为当用户向下滚动时配置文件信息消失了,但分段控件仍然存在,而这正是普通的UITableView标头视图和节标头的行为.导航栏下方的顶部还有一个图像视图,但这对我而言并不重要.这是我认为的可视化效果:

I'm wondering how did Twitter implement it's profile screen. At first I thought it is a table view with a header (profile info) and section header (segmented control to choose tweets/media/favorites). It would make sense for me as the profile info goes away while user scrolls down, but segmented control stays, and that's exactly behavior of plain UITableView header view and section header. There is also an image view at the top, under navigation bar, but that's not what's important for me. Here's a visualization of what I think it is:

我试图在Interface Builder中重新创建它,这就是我得到的.滑块引起了我的注意:它与Twitter应用程序不同,它始于表视图标题的顶部,而不是单元格的顶部.

I tried to recreate it in Interface Builder and that's what I got. The slider drew my attention: it's different than in Twitter app, it starts at the top of table view header, not at the top of cells.

那么……他们是如何实现的呢?他们是否将UITableView放在UIScrollView中并自己处理触摸/滚动事件?我不这么认为,因为不建议这样做,但是我想不出另一种解释.

So… how did they achieve it? Did they put a UITableView in a UIScrollView and handled touch/scroll events themselves? I don't think so, since it's discouraged, but I can't think of another explanation.

推荐答案

我不确定滑块,但在这里,他们在模仿Twitter个人资料视图方面做得很好.因此,仔细看看,也许会对您有所帮助.

I'm not sure about the slider, but here they did pretty good job with mimic twitter profile view. So take a closer look, maybe you'll find this helpful.

这篇关于iOS版本的Twitter个人资料屏幕是如何构建的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 04:28