¡@

Home 

2014/10/16 ¤W¤È 08:26:50

android Programming Glossary: type_item3

Listview with different layout inflation for each row

http://stackoverflow.com/questions/15705832/listview-with-different-layout-inflation-for-each-row

v wDBM6wVEO70 private static final int TYPE_ITEM1 0 private static final int TYPE_ITEM2 1 private static final int TYPE_ITEM3 2 int type @Override public int getItemViewType int position if position 0 type TYPE_ITEM1 else if position 1 type TYPE_ITEM2..

ListView Adapter with arbitrary number of row types (Don't know the number of different row types)

http://stackoverflow.com/questions/17370525/listview-adapter-with-arbitrary-number-of-row-types-dont-know-the-number-of-di

. Example private static final int TYPE_ITEM1 0 private static final int TYPE_ITEM2 1 private static final int TYPE_ITEM3 2 @Override public int getItemViewType int position int type if position 0 your condition type TYPE_ITEM1 type 0 for header.. 0 your condition type TYPE_ITEM1 type 0 for header else if position 1 type TYPE_ITEM2 type 1 for message else type TYPE_ITEM3 type 2 for Quote return type @Override public int getViewTypeCount return 3 three different layouts to be inflated In getView.. header break case TYPE_ITEM2 view mInflater.inflate R.layout.post_text_layout null inflate layout for quote break case TYPE_ITEM3 quote mInflater.inflate R.layout.post_quote_layout null inflate layout for message break .... You need to use a View Holder..

Android: xml layout for a listview with different items

http://stackoverflow.com/questions/18868194/android-xml-layout-for-a-listview-with-different-items

v wDBM6wVEO70 private static final int TYPE_ITEM1 0 private static final int TYPE_ITEM2 1 private static final int TYPE_ITEM3 2 Then int type @Override public int getItemViewType int position if position 0 type TYPE_ITEM1 else if position 1 type.. public int getItemViewType int position if position 0 type TYPE_ITEM1 else if position 1 type TYPE_ITEM2 else type TYPE_ITEM3 return type @Override public int getViewTypeCount return 3 @Override public View getView int position View convertView ViewGroup..