我想在单击单选按钮时设置此布局的动画。但它不起作用
这是我的布局1
单选按钮的状态更改列表
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.radio_button_login){
Animation animation = AnimationUtils.loadAnimation(LoginActivity.this,R.anim.bottom_up);
signUpLayout.setAnimation(animation);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
signUpLayout.setVisibility(View.INVISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}else {
Log.e("TAG", "onCheckedChanged: "+checkedId +" : "+ R.id.radio_button_login );
signUpLayout.setVisibility(View.VISIBLE);
}
}
});
但是当我在布局中单击edittext时,动画才开始
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="200">
<scale android:fromXScale="100%" android:toXScale="100%" android:fromYScale="100%" android:toYScale="0%"/>
</set>
这是我的动画资源
暂无答案!
目前还没有任何答案,快来回答吧!