Android中一个动画应用于两个View中不同步的问题
来源:互联网 发布:立体画图软件 编辑:程序博客网 时间:2024/06/04 18:23
将一个同一个动画应用于两个不同的View中,想让两个View同时向一个方向移动相同的距离。关键代码如下:
Animation topAnimation = new TranslateAnimation(0, 0, 0, -heightOfTopTrans);topAnimation.setDuration(durationMillis);//topAnimation.setInterpolator(this, anim.accelerate_interpolator);topAnimation.setFillAfter(true);mTopLayout.startAnimation(topAnimation);mGridView.startAnimation(topAnimation);
但是事实上于理论的相反,从目前的效果来看,mTopLayout要比mGridView的动画开始的慢,感觉就是先开始的后执行。
为什么会出现这种情况?在网上进行相关搜索后,发现也有人遇到同样的问题,但是没有给出解决方案。
在下面的网页中找到了一些相关的信息:http://stackoverflow.com/questions/9217305/single-animation-multiple-views
其中有部分人的回答如下:
目前 还没有找到相关的解决的方法,如果有高人知道,求指点。
- Android中一个动画应用于两个View中不同步的问题
- Android中VideoView播放视频不能充满屏幕以及视频上的view与视频不同步显示的问题
- Android中View动画
- Android中View的动画效果
- android ListView中item中两个重叠view,一个显示另一个隐藏的方法
- Android中一个Activity两个ListView的显示错误问题
- 在Android中动画移动一个View的位置,采用Scroller类实现
- 解决jsp中验证码不同步的问题
- virt-manager 解决 kvm虚拟机中鼠标不同步的问题
- 解决firefox一个邮箱两个账户导致收藏夹不同步的问题
- Android中为WindowManager添加的View添加动画
- android sqlite中在同一个数据库中建两个表的问题
- Android中View动画的学习掌握(补间动画,属性动画)
- 修改 Android 中两个Activity的过渡动画
- Android中自定义View和自定义动画
- Android中自定义View和自定义动画
- 一个Myeclipse中配置两个tomcat中问题的解决
- Android ScrollView中view.setVisibility(View.VISIBLE)无效的问题
- 为什么证书和配置文件设置正确以后,xcode还是不能发现真机
- js定时循环实现秒表
- ios调用系统界面显示英文。。。
- js读取cookie,js添加cookie,js删除cookie
- Web Browser 的扩展
- Android中一个动画应用于两个View中不同步的问题
- cannot open file mfc42u.lib的问题解决
- 利用onSaveInstanceState()方法保存Activity状态
- python文件头--文件编码指定
- android 【九种对话框】的实现方式
- Action Script 3.0 的优化(下)
- win32 GDI 学习
- 【Android】开机自启动Service
- 强行远程命令
startAnimation
on a view, it starts invalidating itself until it's reached the desired location. When you call it on all the views at once, they'll all callinvalidate()
on themselves, then on the next drawing pass each view will be drawn in their next frame. Since you're calling all this on the UI thread anyway, none of the animations will start until you've returned from that method. NOTE: Using the pre-Honeycomb animation framework merely moves the visual portion of the view. The user won't be able to click on it. – DeeV Feb 9 at 20:10