我的需求
点击 EditText 不弹出软键盘,长按不触发选中,不显示光标,但点击的时候仍可以触发点击事件,并伴有高亮提示
我的解决方法
- 在 XML 中加入以下代码
android:cursorVisible="false" android:focusable="false" android:focusableInTouchMode="false" android:longClickable="false" android:selectAllOnFocus="false"
- 在 Activity 或 Fragment 中直接设置 onClickListener 就行了,然后弹出选择日期时间的对话框,选择完成后 setText。