search

Home  >  Q&A  >  body text

android - GridView中View的复用?

ListView每一行就是一个View,滚出屏幕一条之后,都会缓存一条供后面复用。
那么,
假如一个GridView每行有3个,那么,每当屏幕向上滚出一行,都会有3个View缓存起来吗?
底部取出3个缓存中的View来使用?

迷茫迷茫2772 days ago630

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 16:05:29

    It should be yes, I haven't tested it specifically. You can check whether it is reused by adding some serial numbers such as 0-9 in the process of view creation, taking it out in convertview and printing the log.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 16:05:29

    It can also be understood this way. You can see that gridview is inherited from listview. In fact, I feel it is still the same as listview

    reply
    0
  • Cancelreply