0

i'm ne in android, i make an animation by override setContentView in one activity (only one activity). i try this one and it work :

@Override
public void setContentView(int layoutResID) {
    LayoutInflater inflator=getLayoutInflater();
    View view=inflator.inflate(layoutResID, null, false);
    view.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left));
    super.setContentView(view);
}

the problem is when the animation run, there a white background. how to avoid the white background (i want to show the current view instead of white background when the animation run).

thanks in advance.

4

1 回答 1

0

If all you're trying to do is animate the activity coming in you should use overridePendingTransition. This is the standard way of changing the animation that an activity will use when being started. You might also want to set the theme of your activity to "@android:style/Theme.Translucent.NoTitleBar" in your manifest to remove any unwanted window background from messing with your animation.

于 2013-06-04T14:19:07.347 回答