Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.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_Progress Bar_Simplecursoradapter - Fatal编程技术网

Android 如何在listview中滚动时保持进度条状态

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

我在每个listview行中都有一个水平进度条。 当我选择一行并上传时,我向下滚动,当我返回到我上传的行时,progressbar就行了。当它离开屏幕时,它没有保存状态。 我正在使用SimpleCrsorAdapter和sqlite。 我已经看到了这一点,就像android market应用程序一样,他们做得很好。
有什么帮助吗?我已经用了好几天了。

问题在于你的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;
}