在昨天smoothScrollToPosition完美运行之前,我做了一些设计(添加背景图片)到我的listview.item文件.然后我的lv.smoothScrollToPosition(result.size() - 1)没有完全工作.它仅在显示最后一项时有效.当我将其向上滚动时,它不起作用.setSelection方法工作正常.但是,我需要平稳运动.
这是我的功能:
playGround.notifyDataSetChanged();
activity.getLv().post(new Runnable() {
@Override
public void run() {
activity.getLv().smoothScrollToPosition(result.size()-1);
}
});
Run Code Online (Sandbox Code Playgroud)
playGround.notifyDataSetChanged();
activity.getLv().post(new Runnable() {
@Override
public void run() {
activity.getLv().smoothScrollToPosition(result.size());
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
65 次 |
| 最近记录: |