Android使用动画过程中又设置了View的LayoutParams有卡顿现象处理
2014-07-22 10:49
926 查看
首先给View设置一个动画
监听动画播放完毕的事件,并设置LayoutParams
在播放完毕时清楚动画就可以了
TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, 0, toplayoutheight); translateAnimation2.setDuration(200); framelayout.startAnimation(translateAnimation2);
监听动画播放完毕的事件,并设置LayoutParams
translateAnimation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub toplayout.setVisibility(View.VISIBLE); flp.bottomMargin = -toplayoutheight; framelayout.setLayoutParams(flp); framelayout.clearAnimation();toplayout.clearAnimation(); } });
在播放完毕时清楚动画就可以了
相关文章推荐
- Android 如何动态设置View参数,LayoutParams.addRules详解,TypedValue.applyDimension的使用
- Android动画学习(四)之为ViewGroup中的Layout设置动画实例
- 使用android:layout_weight属性来给view group中各个控件设置所占空间大小比重
- Android中ViewFlipper的使用及设置动画效果实例详解
- Android:Adapter中设置多种type的item的LayoutParams导致的convertView复用异常的问题
- Android关于开发过程中使用Webview时的基本设置。
- Android关于开发过程中使用Webview时的基本设置。
- Android动画学习(四)之为ViewGroup中的Layout设置动画实例
- Android的Animation之LayoutAnimation使用方法(控件设置动画)
- Android动画学习(四)之为ViewGroup中的Layout设置动画实例
- Android抽屉效果(使用LayoutParams来移动View的位置)
- Android的TextView使用Html来处理图片显示、字体样式、超链接等
- Android的TextView/EditText使用CharacterStyle&SpannableString来处理图片显示、字体样式、超链接等
- Android 使用WebView访问https的url——处理SslError
- Android的TextView使用Html来处理图片显示、字体样式、超链接等
- Android的TextView使用Html来处理图片显示、字体样式、超链接等
- android中如何在代码中直接设置View的layout_weight属性
- Android的TextView/EditText使用CharacterStyle&SpannableString来处理图片显示、字体样式、超链接等
- Android的TextView/EditText使用CharacterStyle&SpannableString来处理图片显示、字体样式、超链接等
- Android的TextView使用Html来处理图片显示、字体样式、超链接等