Multiple calling of getView() in GridView

后端 未结 3 497
陌清茗
陌清茗 2021-02-02 17:34

My Activity consists of GridView which holds 40+ elements. After starting activity user could see maximum 15 items (3 rows, 5 items in each row). I wrote in getView() body to pa

3条回答
  •  臣服心动
    2021-02-02 18:20

    The response on that link if quite clear I think

    There is absolutely no guarantee on the number of times getView() will be invoked for any given position

    Now this remark also implies you shouldn't use wrap_content

    usually occurs with lists and grids that have a height set to wrap_content

    But that does not mean it would not happen for other situations. The bug was closed as "WorkingAsIntended", so I don't think you can do too much. It's just something that can happen.

提交回复
热议问题