RecyclerView vs. ListView

前端 未结 16 1932
名媛妹妹
名媛妹妹 2020-11-22 06:07

From android developer (Creating Lists and Cards):

The RecyclerView widget is a more advanced and flexible version of ListView.

<
16条回答
  •  不知归路
    2020-11-22 06:36

    I worked a little with RecyclerView and still prefer ListView.

    1. Sure, both of them use ViewHolders, so this is not an advantage.

    2. A RecyclerView is more difficult in coding.

    3. A RecyclerView doesn't contain a header and footer, so it's a minus.

    4. A ListView doesn't require to make a ViewHolder. In cases where you want to have a list with sections or subheaders it would be a good idea to make independent items (without a ViewHolder), it's easier and doesn't require separate classes.

提交回复
热议问题