在活动标题栏显示加载图标 [英] Show loading icon in the activity titlebar

查看:126
本文介绍了在活动标题栏显示加载图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何显示在活动标题栏的加载图标?

解决方案

  @覆盖
公共无效的onCreate(包冰柱){
    super.onCreate(冰柱);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    的setContentView(R.layout.your_layout);
}
 

则...在任何你想要的:

  //然后,你可以做到这一点,以显示图标
setProgressBarIndeterminateVisibility(真正的);
//或隐藏它
setProgressBarIndeterminateVisibility(假);
 

请务必使用 requestWindowFeature 的setContentView

How do you show a loading icon in the activity titlebar?

解决方案

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.your_layout);
}

Then... where ever you want:

// then, you can do this to show the icon
setProgressBarIndeterminateVisibility(true);
//or to hide it
setProgressBarIndeterminateVisibility(false);

Make sure to use requestWindowFeature before setContentView.

这篇关于在活动标题栏显示加载图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆