thymeleafhtml⽂本,Thymeleaf在html代码中插⼊⽂本?您只需使⽤void toggleViewVisibility(final boolean b, final View v) {
v.setAlpha(b ? 0.0f : 1.0f);
v.setTranslationY(b ? v.getHeight() : 0);
if (b) {
v.setVisibility(View.VISIBLE);
v.animate().alpha(1.0f).translationY(0).setDuration(400);
} else {
v.animate().alpha(0.0f).Height()).setDuration(400).setListener(new Animator.AnimatorListener() {
@Override public void onAnimationStart(Animator animator) {}
@Override public void onAnimationEnd(Animator animator) { v.setVisibility(View.GONE); }
@Override public void onAnimationCancel(Animator animator) {}
@Override public void onAnimationRepeat(Animator animator) {}
});
}
}
void toggleViewVisibilityInit(final boolean b, final View v, final AnimateCheckBox c) {
v.setAlpha(b ? 1.0f : 0.0f);
v.setTranslationY(b ? 0 : v.getHeight());
v.setVisibility(b ? View.VISIBLE : View.GONE);
thymec.setChecked(b);
}属性即可。它在参考⽂档5.1中进⾏了解释:

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。