Android——位移动画
package com.example.imageswitcher;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageSwitcher;
import android.widget.ImageView;
import android.widget.ViewSwitcher;
public class MainActivity extends AppCompatActivity implements View.OnClickListener, ViewSwitcher.ViewFactory {
private ImageSwitcher is_1;
private Button btn_next;
private Button btn_previous;
private int image[]={
R.drawable.pic1,R.drawable.pic2,R.drawable.pic3,R.drawable.pic4};
private int imageIndex = 0;
@Override
protected void onCreate(Bundle