首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Crouton没有显示outAnimation

Crouton没有显示outAnimation
EN

Stack Overflow用户
提问于 2014-03-05 11:54:00
回答 1查看 527关注 0票数 2

我展示了这样一个布鲁顿

代码语言:javascript
复制
    Builder b = new Builder();
    b.setBackgroundColor(R.color.mygreen);
    b.setTextAppearance(R.style.LargeTextWhite);
    Configuration.Builder configBuilder = new Configuration.Builder();
    configBuilder.setInAnimation(R.anim.slide_up).setOutAnimation(
            R.anim.shake);
    b.setConfiguration(configBuilder.build());
    Crouton.makeText(getActivity(),
            "" + e.getResult().getTotalCount() + " Treffer", b.build(),
            root).show();

其中rootViewGroup

inAnimation显示,outAnimation没有显示,Crouton只是消失了。其他人也经历过这种情况,或者知道为什么它不起作用?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-25 11:48:20

我也遇到了这个问题,我查看了演示的源代码,发现您的“根”应该是:

代码语言:javascript
复制
<LinearLayout
            android:id="@+id/croutonContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" />


private void showCustomViewCrouton() {
        View view = getLayoutInflater(null).inflate(R.layout.layout_crouton_custom_view, null);
        final Crouton crouton;
        final Configuration croutonConfig =  new Configuration.Builder().setDuration(Configuration.DURATION_SHORT).setInAnimation(android.R.anim.fade_in).setOutAnimation(android.R.anim.fade_out).build();
        crouton = Crouton.make(getActivity(), view, R.id.croutonContainer, croutonConfig);
        crouton.show();
      }

最后修正了我的problem.Hope --它对您有用:)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22196989

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档