中级进展不与姜饼运行ActionBarSherlock工作 [英] Intermediate Progress doesn't work with ActionBarSherlock running on Gingerbread

查看:120
本文介绍了中级进展不与姜饼运行ActionBarSherlock工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置ActionBarSherlock与我的应用程序,我想用中级的进展,我使用的是这样的:

I setup ActionBarSherlock with my app, and I'm trying to use the Intermediate Progress, I'm using this:

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);    
    setSupportProgressBarIndeterminateVisibility(false);

在我的onCreate,然后使用:

In my onCreate, and then using:

    setSupportProgressBarIndeterminateVisibility(true);

要启用它。

它工作正常,在ICS,但它不能在姜饼或升级Froyo在所有的工作,没有人知道如何得到它的工作?谢谢

It works fine in ICS but it doesn't work at all in Gingerbread or Froyo, does anyone know how to get it to work? Thanks

推荐答案

我有同样的问题。杰克的解决方案上面没有解决问题,我 - 该方法是不确定的。

I just had the same problem. Jake's solution above did not fix it for me - the method is undefined.

我发现张贴杰克的错误列表ActionBarSherlock在这里工作的解决方案:

I found a working solution posted by Jake on the bug list for ActionBarSherlock here:

见杰克的反应,海报 - 关键是要叫 getSupportActionBar()第一,触发创作的意见

See Jake's response to the poster - the trick is to call getSupportActionBar() first, to "trigger creation of the views".

所以,我的的onCreate()的方法是:

protected void onCreate(Bundle arg0)
{
    super.onCreate(arg0);

    // allow window to show progress spinner in the action bar
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    getSupportActionBar();
    setSupportProgressBarIndeterminateVisibility(false); 
}


基于评论来自劳克斯更新:

请确保您的进口反映出 com.actionbarsherlock.view.Window.FEATURE_INDETERMINATE_PROGRESS 为此工作。

Make sure your imports reflect com.actionbarsherlock.view.Window.FEATURE_INDETERMINATE_PROGRESS for this to work.

下面是我的导入的一部分从一个应用程序,使用此模式块:

Here is part of my import block from an app that uses this pattern:

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.ActionProvider;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
import com.actionbarsherlock.widget.ShareActionProvider;

这是一件非常好的事情了ABS工作时,要记住 - 你的许多正常的Andr​​oid进口应更新为参考ABS代替。

This is a very good thing to remember when working with ABS - many of your normal Android imports should be updated to refer to ABS instead.

这可能是一个好主意,重温您的导入块,或者可能完全删除它,让Eclipse的重建为你(CTRL-SHIFT-O),以该点Ecl​​ipse会提示您为每个进口的ABS redeclares。

It may be a good idea to revisit your import block, or possibly remove it entirely and let Eclipse rebuild it for you (CTRL-SHIFT-O) to which point Eclipse will prompt you for each import that ABS redeclares.

这也是在他的回答。

这篇关于中级进展不与姜饼运行ActionBarSherlock工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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