安卓图片轮播实现---banner
需要添加依赖包 implementation 'com.youth.banner:banner:1.4.10' 2.`public class MainActivity extends AppCompatActivity { Banner banner; private List<Integer> images = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initimageviewpager(); } public void initimageviewpager(){ Log.d("图片轮播函数", "initimageviewpager: "); images.add(R.drawable.image1); images.add(R.drawable.image2); images.add(R.drawable.image3); banner = findViewById(R.id.banner); // banner = (Banner)findViewById(R.id.banner); banner