经过长时间的研发,我通过创建自己的自定义编辑文本成功地解决了这个问题,它完全符合我的要求。
public class CustomEditText extends EditText {
private Animation rotateAnim;
public CustomEditText(Context context) {
super(context);
}
public CustomEditText(Context context, AttributeSet attrs){
super(context, attrs);
}
private void createAnim(Canvas canvas) {
rotateAnim = new RotateAnimation(0, -45, 250, 50);
rotateAnim.setRepeatCount(Animation.INFINITE);
startAnimation(rotateAnim);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// creates the animation the first time
if (rotateAnim == null) {
createAnim(canvas);
}
}
}