0
可能重复:
Android ListView setSelection() does not seem to work关注列表视图中的最后一个项目
在滚动列表视图,当达到列表的末尾,当我获取其他批次的数据,获取后已完成,我想在滚动前关注列表视图的最后一项。 setSelection()
不起作用。任何人都可以提出更好的选择。
可能重复:
Android ListView setSelection() does not seem to work关注列表视图中的最后一个项目
在滚动列表视图,当达到列表的末尾,当我获取其他批次的数据,获取后已完成,我想在滚动前关注列表视图的最后一项。 setSelection()
不起作用。任何人都可以提出更好的选择。
试试这个:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
LayoutInflater inflator = mContext.getLayoutInflater();
view = inflator.inflate(android.R.layout.your_item_layout, null);
}
//your specific code here
if (position == mList.size()-1){
//fetch other batch of data
}
return view;
}
getView方法,因为预压的越来越屏幕上可见之前调用。但我认为,这就是你要找的。
http://stackoverflow.com/questions/1446373/android-listview-setselection-does-not-seem-to-work – RobinHood