【发布时间】:2014-12-15 11:33:36
【问题描述】:
我可以通过其他方式显示不使用toast message 的错误消息吗?请帮我?
而且我也不想显示弹出窗口..
【问题讨论】:
-
也可以在android中使用Coustem Toast和Dialog来显示错误信息
标签: android error-handling android-toast
我可以通过其他方式显示不使用toast message 的错误消息吗?请帮我?
而且我也不想显示弹出窗口..
【问题讨论】:
标签: android error-handling android-toast
使用动画,点击edittext(如果为空)
Animation shake = AnimationUtils.loadAnimation(LoginActivity.this,
R.anim.shake);
editTextId.startAnimation(shake);
在 res 中创建文件夹动画
添加文件shake.xml
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromXDelta="0"
android:interpolator="@anim/cycle_7"
android:toXDelta="10" />
文件cycle_7.xml
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="7" />
【讨论】:
使用setError()方法,你可以像edittext.setError("ur message",icon);一样使用
【讨论】: