Ye *_*ung 3 android android-gallery android-animation
我有画廊小部件包含1-10张图片要滑动.我知道当我对屏幕进行条纹处理时,图像会从左向右滚动.我希望自动循环画廊10后自动启动第一张图像,是否有任何自动循环适配器或方式???
final Gallery g = (Gallery) findViewById(R.id.gallery);
g.setAdapter(new ImageAdapter(this));
Animation animation = AnimationUtils.loadAnimation(this,
R.anim.rotate_indefinitely);
animation.getInterpolator();
animation.setDuration(1000);
animation.setStartOffset(200);
animation.setRepeatMode(2);
animation.setFillAfter(false);
animation.setFillEnabled(true);
g.setAnimation(animation);
g.startAnimation(animation);
Run Code Online (Sandbox Code Playgroud)
但我只看到第一张图片是动画的..
看看我的视频 ......
为Gallery编写一个SpinnerAdapter,它在getCount()方法中返回Integer.MAX_VALUE.然后,当在getDropDownView()和getView()中返回View时,将实际项目计数的模数应用于position参数.
| 归档时间: |
|
| 查看次数: |
4814 次 |
| 最近记录: |