您的位置:首页 > 移动开发 > Android开发

android学习之EditText需要点击两次触发onclick问题解决

2016-03-06 15:39 609 查看
Unlike most other controls,
EditText
s are focusable while the system is in ‘touch mode’. The first click event focuses the control, while the second click event actually fires the
OnClickListener
. If you disable touch-mode focus with the
android:focusableInTouchMode
View attribute, the
OnClickListene
r should fire as expected.

<EditText
android:text="@+id/EditText01"
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusableInTouchMode="false" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: