use*_*701 31 android android-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上.
谢谢
Mar*_*inS 76
没有代码标签的道歉,从手机发布......
这是来自ActionbarSherlock(谷歌,如果你没有遇到它,允许在蜂窝前的动作栏支持)
在onCreate的主要活动
// This has to be called before setContentView and you must use the
// class in android.support.v4.view and NOT android.view
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
Run Code Online (Sandbox Code Playgroud)
在操作栏中显示/隐藏进度.注意使用actionbarsherlock你必须使用boolean.TRUE/FALSE,而不仅仅是true/false .........
if (getSupportLoaderManager().hasRunningLoaders()) {
setProgressBarIndeterminateVisibility(Boolean.TRUE);
} else {
setProgressBarIndeterminateVisibility(Boolean.FALSE);
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
31364 次 |
最近记录: |