我的EditText
包含在TextInputLayout
inside
LinearLayout
中,我希望在{{1}时显示fragment
是LinearLayout
。但是touched
正在截取EditText
。
我尝试在touch
和focusable="false"
上设置clickable="false"
和EditText
,但现在TextInputLayout
除了更改提示{{}之外没有做任何事情1}}一点点。
由于灰色touch
更改,我不想设置color slightly
。
我的xml:
enabled="false"
我现在的解决方案:只需在edittext
之上放置一个视图答案 0 :(得分:1)
试试这个,可能是它的工作
在线性布局中设置
android:clickable="true"
在editText中设置
android:clickable="false"
android:focusable="false"
从TextInputlayout中移除此2行
android:clickable="false"
android:focusable="false"
答案 1 :(得分:0)
试试android:enabled="false"
。我不确定,但它可能有效。
答案 2 :(得分:0)
尝试在LinearLayout上使用android:descendantFocusability="blocksDescendants"
,让儿童观看无法集中注意力。
您也可以尝试使用两种可聚焦属性
android:focusable="false"
android:focusableInTouchMode="false"
修改强>
对LinearLayout的每个子视图尝试android:duplicateParentState="true"
。您还可以查看this question。有人提到EditText上的inputType
可以拦截点击。