search

Home  >  Q&A  >  body text

android - 类似于微信朋友圈图片这样的是在listview中嵌套gridview还是动态加入多个imageview呢?

类似于微信朋友圈图片这样的是在listview中嵌套gridview还是动态加入多个imageview呢?

怪我咯怪我咯2771 days ago586

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-18 09:19:23

    It should be to add multiple imageviews dynamically. You can turn on the display layout boundary in the developer options, or GPU overdrawing. You will find that the overdrawing of the image list becomes less the further back and more towards the front, such as three pictures per line. In this case, the first picture is the darkest, with at least three layers of layout, the second picture is slightly lighter, and the last picture is basically not overdrawn. I guess WeChat may use a cascading type of layout, such as RelativeLayout

    reply
    0
  • 黄舟

    黄舟2017-04-18 09:19:23

    Generally, the first View will not be measured multiple times in AbsListView里再嵌套使用AbsListView的, onMeasure(...). Therefore, it may cause the scrolling to be stuck.

    You can consider using

    to implement it. Use Baidu or Google. GridLayout + ViewStubYou can also consider customizing the view.

    Reference open source projects:

    • github: qii/weiciyuan - Sina Weibo Android Client, Four Dimensions This is a very old project

    • reply
      0
  • Cancelreply