AdapterViewFlipper 图片_文字 轮播动画控件,flutter局部刷新

这篇博客介绍了如何在Flutter应用中实现文字和图片的轮播效果,通过TextFlipperAdapter和ImgFlipperAdapter两个自定义适配器,结合布局和动画资源,实现了局部刷新的轮播控件。同时,提供了布局文件和动画配置的详细说明。
摘要由CSDN通过智能技术生成

// 文字轮播
private fun initTextFlipper() {
textFlipper = findViewById(R.id.text_flipper)
val list = listOf(“文字轮播测试0”, “文字轮播测试02…”)
textFlipper?.adapter = TextFlipperAdapter(this, list)
textFlipper?.setInAnimation(this, R.animator.text_flipper_in_from_bottom)
textFlipper?.setOutAnimation(this, R.animator.text_flipper_out_to_top)
// textFlipper?.flipInterval
// textFlipper?.startFlipping()
}

// 图片轮播
private fun initImgFlipper() {
imgFlipper = findViewById(R.id.img_flipper)
val list = listOf(“http://www.nicesoso.com/test/file/img/test.jpg”, “http://www.nicesoso.com/test/file/img/test_h_1.jpg”,
“http://www.nicesoso.com/test/file/img/test_h_2.jpg”)
imgFlipper?.adapter = ImgFlipperAdapter(this, list)
imgFlipper?.setInAnimation(this, R.animator.img_flipper_in)
preBtn = findViewById(R.id.prev_btn)
nextBtn = findViewById(R.id.next_btn) as

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值