创建像Instagram这样的滚动布局 [英] Create scroll layout like Instagram

查看:196
本文介绍了创建像Instagram这样的滚动布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设计一个具有新供稿屏幕的应用程序,例如Instagram应用程序.

I want to design a app which have a new feed screen like Instagram app.

如果您使用过Instagram,则可以看到在向上滚动时工具栏将向上推并替换为feed的标题. (好吧,我可以在支持Android的设计上做到这一点.)

If you have used Instagram you can see when you scroll up the toolbar will push up and replaced by header of feed. (Ok, I can do it which android support design) .

当您继续滚动时,第二个Feed的标题将向上推并替换第一个Feed的标题.我不知道他们该怎么做?他们如何检测物品何时结束?

When you continue scroll, the header of the second feed will push up and replace the header of the first. I wonder how can they do that ? How can they detect when an item is over ?

此视频演示了instagram应用如何滚动:

This video demo how instagram app scroll :

https://www.youtube.com/watch?v=ThzZlrKVY-g

对不起,我的语法,谢谢您!

Sorry about my grammar, Thank in advanced !!!

推荐答案

我认为您倾向于粘性标头.有许多现有的轻量级库可以使您的生活更轻松.

I think you're leaning towards Sticky Headers. There are many existing lightweight libraries out there that will make your life easier.

查看 StickyHeadersRecycleView (有一个GIF展示其工作原理)

Check out StickyHeadersRecycleView (Has a GIF to show how it works)

备用选项,也是一个库.. StickyHeader

Alternate option, also a library.. StickyHeader

这篇关于创建像Instagram这样的滚动布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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