OnClickListener not working for first item in GridView

前端 未结 7 1548
一向
一向 2020-12-03 02:54

I have a problem with creating a GridView-based calendar. Here is the Grid:

\"GridView

This

7条回答
  •  旧时难觅i
    2020-12-03 03:51

    For what it's worth, I had also this issue (first cell in the gridview having delayed onclick).

    In my case, I was using a (lightly customized) gridviews with dynamic sets of imageviews that I would make visible/gone and redraw the gridview. All imageviews where prepared beforehand and stored in the adapter.

    Initially, I used notifyDataSetChanged() on the adapter but this resulted in the delayed click problem for the first cell whenever the set was updated. I changed to just invalidating the gridview and now things are fine. Bear in mind that all my views are already created and stored in the adapter, its just the getview method that checks which ones are really visible.

提交回复
热议问题