老师,我这是什么鬼?
图片完全不显示,数字完全错误
public class MainActivity extends AppCompatActivity { private ListView lv1; private SimpleAdapter simpleAdaper; private List<Map<String, Object>> dataList; private String[] context = {"第一行", "第二行", "第三行", "第四行",}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lv1 = (ListView) findViewById(R.id.listview_1); dataList=new ArrayList<Map<String, Object>>(); simpleAdaper=new SimpleAdapter(this,getData(),R.layout.layout1,new String[]{"pic","text"},new int[]{ R.id.textview_1, R.id.imageview_1}); lv1.setAdapter(simpleAdaper); } private List<Map<String, Object>> getData(){ for (int i=0;i<20;i++){ Map<String,Object> map=new HashMap<String, Object>(); map.put("pic",R.mipmap.ic_launcher); map.put("text","吃屎"+i); dataList.add(map); } return dataList; }