Nul*_*ion 14 android android-animation
我创建了一个由ViewSwitcher组成的广告控件....
在该控件中我有ImageView和TextView,因为广告是文本或图像..
现在我必须给advetisements动画..
我试过以下
动画inAnimation = AnimationUtils.loadAnimation(this,android.R.anim.slide_in_left); inAnimation.setDuration(1500);
动画outAnimation = AnimationUtils.loadAnimation(this,android.R.anim.slide_out_right); outAnimation.setDuration(1500);
我把它设置为切换台
ViewSwitcher切换器;
switcher.setInAnimation(inAnimation);
switcher.setOutAnimation(outAnimation);
但它不会工作..
请给我任何其他选择..或者如果使用上面的代码是错误的,那么如何使用它?
小智 30
尝试在xml中设置动画为
<ViewSwitcher
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:inAnimation="@android:anim/slide_in_left"
android:outAnimation="@android:anim/slide_out_right" >
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11979 次 |
| 最近记录: |