相关疑难解决方法(0)

在ActionBar上显示进度微调器(刷新)?

我正在使用ActionBar.如果我将它设置为旋转,我想在标题栏上有一个刷新进度微调器 - 否则隐藏它.那可能吗?:

// My menu has a refresh item, but it shouldn't be visible on the
// actionbar unless it's spinning.
<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:id="@+id/menu_refresh"
    android:title="@string/refresh"
    android:icon="@drawable/ic_action_refresh" />
</menu>

...

// When I need to show some work being done on my activity,
// can I somehow now make the spinner associated with the
// refresh item become visible on the action bar?
getActionBarHelper().setRefreshActionItemState(true);
Run Code Online (Sandbox Code Playgroud)

除非它正在"进行中"/旋转,否则我不希望它在ActionBar上.

谢谢

android android-actionbar

31
推荐指数
1
解决办法
3万
查看次数

标签 统计

android ×1

android-actionbar ×1