我有一个自定义的listview和textview,checkbox,edittext在上面。我想迭代我的listview行,并获取textview、checkbox和edittext的值。当迭代到达页面末尾时,不能使用不可见的行、部件值和崩溃。我想我必须自动向下滚动我的列表视图。如何解决此问题?
注意:我有12行,但是它在第6行之后崩溃了,如果不向下滚动我的listview,cz就不能看到第7行。
这是我的代码:
public void onSave(View view) {
ArrayList<String> olcum = new ArrayList<String>();
ArrayList<String> orneklemebuyukluk = new ArrayList<String>();
EditText et;
CheckBox chx;
TextView buyukluk;
String nitel="0";
for (int i = 0; i < list_olcum_view.getCount(); i++) {
view = list_olcum_view.getChildAt(i);
et = (EditText) view.findViewById(R.id.edt_olcum);
chx=(CheckBox)view.findViewById(R.id.txt_orneklemenitel);
olcum.add(et.getText().toString());
}
}发布于 2016-10-21 19:59:57
Note: I have 12 rows but it crashs after 6th row cz cannot see 7th row without scrolldown my listview.
public void onSave(View view) {
ArrayList<String> olcum = new ArrayList<String>();
ArrayList<String> orneklemebuyukluk = new ArrayList<String>();
EditText et;
CheckBox chx;
TextView buyukluk;
String nitel="0";
for (int i = 0; i < list_olcum_view.getCount(); i++) {
view = list_olcum_view.getChildAt(i);
et = (EditText) view.findViewById(R.id.edt_olcum);
chx=(CheckBox)view.findViewById(R.id.txt_orneklemenitel);
olcum.add(et.getText().toString());
}
}https://stackoverflow.com/questions/40175991
复制相似问题