【问题标题】:SwipeRefreshLayout with listview and emptyViewSwipeRefreshLayout 与 listview 和 emptyView
【发布时间】:2014-10-26 15:54:12
【问题描述】:

我有一个带有列表视图的 SwipeRefreshLayout,这个列表视图有一个空视图,但是当列表视图为空时,它显示他的空视图,但是 SwipRefreshlayout 上的刷新不起作用..

为什么?

【问题讨论】:

    标签: android listview swiperefreshlayout empty-list


    【解决方案1】:

    我也遇到过这个问题。 要修复它,您可以设置 emptyView 可点击,像这样

    View emptyView = findViewById(R.id.empty);
    emptyView.setClickable(true);
    commentsLV.setEmptyView(emptyView);
    

    我在 Android support v4 SwipeRefreshLayout empty view issue第一条评论)。


    但是,它使 swipeRefreshlayout 可以在错误的位置滑动。您可以通过扩展 swipeRefreshlayout 来修复它,或者参考这个SwiperefreshLayout in Android


    如果您在使用 swiperefreshlayout 时想要一个方便的解决方案,您可以将您的 listview 和 emptyview 放在一个框架布局中,并决定代码中 Emprtyview 的可见性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-02
      • 1970-01-01
      • 2015-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多