Android 如何在listview中滚动时保持进度条状态
我在每个listview行中都有一个水平进度条。 当我选择一行并上传时,我向下滚动,当我返回到我上传的行时,progressbar就行了。当它离开屏幕时,它没有保存状态。 我正在使用SimpleCrsorAdapter和sqlite。 我已经看到了这一点,就像android market应用程序一样,他们做得很好。Android 如何在listview中滚动时保持进度条状态,android,listview,progress-bar,simplecursoradapter,Android,Listview,Progress Bar,Simplecursoradapter,我在每个listview行中都有一个水平进度条。 当我选择一行并上传时,我向下滚动,当我返回到我上传的行时,progressbar就行了。当它离开屏幕时,它没有保存状态。 我正在使用SimpleCrsorAdapter和sqlite。 我已经看到了这一点,就像android market应用程序一样,他们做得很好。 有什么帮助吗?我已经用了好几天了。问题在于你的getView方法,我也在使用bindview。我将很快发布我的代码。 public View getView(final int po
有什么帮助吗?我已经用了好几天了。问题在于你的getView方法,我也在使用bindview。我将很快发布我的代码。
public View getView(final int position, View convertView, ViewGroup parent) {
ProgressBar progressBar = (ProgressBar)view.findViewById(R.id.progressBar);
Rect bounds = progressBar.getProgressDrawable().getBounds();
... do your work here
//reset the bounds before return the view
progressBar.getProgressDrawable().setBounds(bounds);
return view;
}