如何在列表视图中滚动时保持进度条状态

发布于 2024-11-26 15:53:56 字数 177 浏览 3 评论 0原文

我在每个列表视图行中有一个水平进度条。 当我选择一行并上传时,我向下滚动,当我回到要上传的行时,进度条消失了(当它离开屏幕时,它不会保存状态)。 我正在使用 SimpleCursorAdapter 和 sqlite。 我已经看到这个工作,就像 Android 市场应用程序一样,而且他们做得很好。 有什么帮助吗?我已经研究这个好几天了。

I have a horizontal progressbar in a each listview row.
While i select a row and upload, i am scrolling down and when i come back to the row that i was uploding, the progressbar is gone(it is not saving the state when it goes off screen).
I am using SimpleCursorAdapter and sqlite.
I have seen this working, like the android market app, and they do it well.
Any help? I have been on this for days.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

始终不够 2024-12-03 15:53:56
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;
}
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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文