Android 刷新时,如何在(sherlock)列表视图中恢复负载指示器?

Android 刷新时,如何在(sherlock)列表视图中恢复负载指示器?,android,actionbarsherlock,Android,Actionbarsherlock,观察下图。在我在SherlockListFragment中设置ListAdapter之前,它将显示在ListView数据的位置。我不知道这是SherlockActionBar的产品还是标准Android的产品,但无论如何——我以后怎么把它带回来呢?我的用例是,我有一个刷新按钮,当用户按下该按钮时,我希望在加载时清除列表并再次显示微调器 在SherlockListFragment中,调用setListShownfalse SherlockListFragment扩展的兼容性文档包括: 控制是否显示

观察下图。在我在SherlockListFragment中设置ListAdapter之前,它将显示在ListView数据的位置。我不知道这是SherlockActionBar的产品还是标准Android的产品,但无论如何——我以后怎么把它带回来呢?我的用例是,我有一个刷新按钮,当用户按下该按钮时,我希望在加载时清除列表并再次显示微调器

在SherlockListFragment中,调用setListShownfalse

SherlockListFragment扩展的兼容性文档包括:

控制是否显示列表。你可以做到不 在等待初始数据显示时显示。 在此期间,将显示一个不确定的进度指示器 相反

当然,一旦完成刷新,请调用setListShowntrue

在SherlockListFragment中,调用setListShownfalse

SherlockListFragment扩展的兼容性文档包括:

控制是否显示列表。你可以做到不 在等待初始数据显示时显示。 在此期间,将显示一个不确定的进度指示器 相反

当然,一旦完成刷新,请调用setListShowntrue

建议调用

@Override
public void onStart() {
    super.onStart();

    // When in two-pane layout, set the listview to highlight the selected
    // list item
    // (We do this during onStart because at the point the listview is
    // available.)
    if (getFragmentManager().findFragmentById(R.id.article_fragment) != null) {

        getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        setListShown(true);
    }
}
推荐电话

@Override
public void onStart() {
    super.onStart();

    // When in two-pane layout, set the listview to highlight the selected
    // list item
    // (We do this during onStart because at the point the listview is
    // available.)
    if (getFragmentManager().findFragmentById(R.id.article_fragment) != null) {

        getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
        setListShown(true);
    }
}