TextView的折叠和扩展,可以设置默认行数


TextVIew.getLineHeight();

TextView.getLineCount();

private voiddoAnimation(intstartHeight,intendHeight) {

ValueAnimator animator = ValueAnimator.ofInt(startHeight, endHeight);

animator.setDuration(600);

animator.setTarget(mDescribeDetailTv);

animator.addUpdateListener(newValueAnimator.AnimatorUpdateListener() {

@Override

public voidonAnimationUpdate(ValueAnimator animation) {

intheight = (int) animation.getAnimatedValue();

ViewGroup.LayoutParams params =mDescribeDetailTv.getLayoutParams();

params.height= height;

mDescribeDetailTv.setLayoutParams(params);

}

});

animator.start();

}


你可能感兴趣的:(TextView的折叠和扩展,可以设置默认行数)