Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android中更改listview上的复选框位置_Android_Listview_Checkbox - Fatal编程技术网

如何在Android中更改listview上的复选框位置

如何在Android中更改listview上的复选框位置,android,listview,checkbox,Android,Listview,Checkbox,我想更改ListView中复选框项目的位置 ListView lv = (ListView) findViewById(com.inomera.sanalmarket.main.R.id.listView1); ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_checked , ShoppingListDataManager.getInsta

我想更改ListView中复选框项目的位置

    ListView lv = (ListView) findViewById(com.inomera.sanalmarket.main.R.id.listView1);

    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_checked , ShoppingListDataManager.getInstance().shoppingNotes);

    lv.setAdapter(adapter);
ListView lv=(ListView)findViewById(com.inomera.sanalmarket.main.R.id.listView1);
ListAdapter=new ArrayAdapter(此,android.R.layout.simple_列表_项目已选中,ShoppingListDataManager.getInstance().shoppingNotes);
低压设置适配器(适配器);
这是我的listview代码。
我如何才能到达简单列表项目检查项目并更改位置?

定义您自己的布局,而不是使用
android.R.layout.simple列表项目检查项目

您可以在以下位置的sdk文件夹中找到原始文件:

android sdk\platforms\android-X\data\res\layout


其中,X是数字1-13,您应该实现自己的适配器,然后再实现它。。请参考NTC的回答。如果您仍然使用android.R.layout.simple\u list\u item\u checked,实现您自己的适配器将不会移动复选框。。。您需要为listitem定义自己的布局!省去了自己实现适配器的麻烦,只需更改布局即可