Best way to build and handle List view with differing rows

前端 未结 2 1688
予麋鹿
予麋鹿 2021-01-26 02:56

In my app, I show data in a list view. It looks as below.

\"enter

Each row in lis

2条回答
  •  天涯浪人
    2021-01-26 03:17

    ListView is supposedly used to relieve the coders of some burden when each row has similar repetitive pattern. Yes, for slight variations getViewType is the correct choice to implement, but I see a better solution to your problem: you should create your own linearlayout if you have a lot of customization requirement. Remember that listview itself is an expensive object to create. Create a custom linearlayout is not that hard.

提交回复
热议问题