Pinterest style listview or gridview in android [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-04 23:39:59

I never thought about it until you brought it up, but this is an interesting problem to try an solve. My suggestion would be to fit 3 ListView's into the Activity or Fragment. I assume each one recycles their own View's respectively. This solves your performance pretty easily assuming it is safe to do it. So maybe a horizontal LinearLayout that holds the 3 ListViews. Adding some padding to the middle one would produce the desired effect.

Of course, more thought needs to be put into deciding how the images end up where they are, but that is you to figure out :) Hope this gives you some ideas!

I would do it this way:

ScrollView
  LinearLayout (horizontal)
    LinearLayout (vertical, layout weight for width)
      [All the content in column 1]
    LinearLayout (vertical, layout weight for width)
      [All the content in column 2]
    LinearLayout (vertical, layout weight for width)
      [All the content in column 3]

Use lazy loading for the pictures if there are thousands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!