Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要使用两种类型的列表项创建一个 ListView。
ListView 模型如下:
我怎样才能做到这一点?
也许你应该试试这个:
@Override public View getView(int position, View convertView, ViewGroup parent) { if (position % 2 == 0) { //inflate your one cell layout } else { //inflate your two cell layout } return view; }