android - Inflating multiple layouts in list view ? -


have fragment listview should inflated follows : 1 different layout (custom row),position 2 (slider) , position 3 (item_layout) have gone through quite lot of resources on web , stack overflow didn't solve purpose looking sample or tutorial of kind.

it better use header instead of different types of items, because not recycle first 2 rows.

note: when first introduced, method called before setting adapter setadapter(listadapter).

example:

    listview listview = view.findviewbyid(r.id.list);      view header = layoutinflater.from(getactivity()).inflate(r.layout.your_first_two_rows, listview, false);     listview.addheaderview(header);      listview.setadapter(new yourcustomadapter(...)); 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -