How is the getView() method used and where is it getting called?

后端 未结 2 1632
梦谈多话
梦谈多话 2021-01-03 21:25

I am new to Android development and have been following the tutorials available on the Android website. I am currently on the section of tutorials for Views, specifically th

2条回答
  •  旧时难觅i
    2021-01-03 22:01

    Adapter.getView is called inside ObtainView method, inherited from GridView parent class AbsListView, with ScrapView objects passed in when available:

    child = mAdapter.getView(position, scrapView, this);
    

    Then ObtainView is implemented in GridView.onMeasure directly but also in several more callbacks that invoke GridView.layoutChildren, including inherited onTouchEvent method which handles scroll, fling and other touch navigation.

提交回复
热议问题