了slideDown和动画的android效果基本show布局 [英] Slidedown and slideup layout with animation android
本文介绍了了slideDown和动画的android效果基本show布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎么能与效果基本show中央显示布局时我preSS按钮,preSS再次隐藏...在了slideDown ANDROID
how can I display a layout in the center with slideUp when I press the button, and press again to hide ... slideDown in ANDROID
帮助我与,thnkss
help me with that, thnkss
推荐答案
在创建资源2动画XML /阿尼姆文件夹
Create two animation xml under res/anim folder
slide_down.xml
slide_down.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="1000"
android:fromYDelta="0"
android:toYDelta="100%" />
</set>
slide_up.xml
slide_up.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="1000"
android:fromYDelta="100%"
android:toYDelta="0" />
</set>
加载动画像波纹管code,并开始在您需要根据您的要求的动画
Load animation Like bellow Code and start animation when you want According to your Requirement
//Load animation
Animation slide_down = AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.slide_down);
Animation slide_up = AnimationUtils.loadAnimation(getApplicationContext(),
R.anim.slide_up);
// Start animation
linear_layout.startAnimation(slide_down);
这篇关于了slideDown和动画的android效果基本show布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文