2016-08-10 2 views

답변

3

한 가지 방법은 다음과 같은 트윈 애니메이션을 사용하는 것입니다 일반 JPG 또는 PNG 이미지 대신 시작 화면에서 사용할 수 있습니다. 그런 다음

ImageView image = (ImageView)findViewById(R.id.imageView); 
     Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.move); 
     image.startAnimation(animation1); 

를 다음을 수행 흰색 원 이미지에 애니메이션이있는 경우 이제 입술에 ANIM 파일을 만들 필요가 같이 귀하의 경우에는

Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.myanimation); 

말/ANIM/이동 하나 이상의 anim 파일이 필요합니다 .xml

<?xml version="1.0" encoding="utf-8"?> 
<set 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/linear_interpolator" 
    android:fillAfter="true"> 

    <translate 
     android:fromXDelta="0%p" 
     android:toXDelta="75%p" 
     android:duration="800" /> 
</set> 

이것은 예입니다. 요구 사항에 맞게 이러한 기본 애니메이션을 수정할 수있는 방법을 찾아야합니다. 자세한 내용은 this을 참조하십시오.

0

당신은 다음과 같이 GIF 이미지를 사용하고

+1

이것은 코멘트 일 수 있습니다. –

3

스플래시 화면에 gif를 사용하려면 다음을 수행하십시오.

<pl.droidsonroids.gif.GifImageView 
    android:id="@+id/gifView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:src="@drawable/gif" 
    /> 

그리고 마지막으로 당신의 클래스 파일 : 당신의 활동 레이아웃에서

compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+' 

: 당신의 build.gradle 파일에서

private static int SPLASH_TIME_OUT = 1500; 
private boolean isInFront; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_splash_gif); 
    new Handler().postDelayed(new Runnable() { 

     @Override 
     public void run() { 
      // This method will be executed once the timer is over 

      if(isInFront) 
      { 
       // Start your app main activity 
       Intent i = new Intent(SplashScreen_Gif.this, MainMenuActivity.class); 
       startActivity(i); 
      } 

      // close this activity 
      finish(); 
     } 
    }, SPLASH_TIME_OUT); 
} 
관련 문제