我如何在动画中摆脱这种黑条? [英] How do I get rid of this black bar during animation?

查看:167
本文介绍了我如何在动画中摆脱这种黑条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在一个活动的过渡执行自定义动画。该活动应该滑动顺利向上而不是从侧。它的工作原理,但是该视图对视图的顶部一个黑条(大小相同的状态栏)。我怎样才能摆脱黑条?这里是code我使用:

I'm trying to perform a custom animation on an Activity transition. The activity is supposed to slide smoothly upward instead of from the side. It works, but the view has a black bar (the same size as the status bar) on the top of the view. How can I get rid of the black bar? Here is the code I'm using:

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  overridePendingTransition(R.anim.upin, R.anim.upout);
  setContentView(R.layout.screen_login);
}

动画UPIN:

the animation upin:

<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate android:fromYDelta="100%" android:toYDelta="0%" android:duration="500" />
</set>

动画upout:

the animation upout:

<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate android:fromYDelta="0%" android:toYDelta="0%" android:duration="500" />
</set>

编辑:如果我让所有的活动全屏它完美。当然,我不希望所有的活动进行全屏。

If I make all the Activities fullscreen it works perfectly. Of course, I don't WANT all the Activities to be fullscreen.

推荐答案

好吧,我尝试了一些东西,像制作相对于父,等等。我觉得最核心的问题是,该活动已经在额外的空间三角洲顶部,其是黑条。有没有真正什么做什么呢,据我可以看到除了拉出来活动,并使其成为一个视图。

Okay, I tried a few things, like making the deltas relative to the parent, etc. I think the core problem is that the activity has extra space at the top, which is that black bar. There's not really anything to be done about it as far as I can see except to pull it out of the activity and make it a view.

配售的查看到ViewAnimator,然后设置进出过渡到那些我已经上市的作品就像一个魅力。我相当确信没有其他办法做到这一点。如果有谁数字一出来,让我知道,但是这解决了我的问题。

Placing that view into a ViewAnimator and then setting the in and out transitions to those I already listed works like a charm. I'm fairly convinced that there is no other way to do this. If anyone ever figures one out, let me know, but this solves my problem.

这篇关于我如何在动画中摆脱这种黑条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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