2017-05-10 9 views
0

안에 나는 insideLinearLayoutTextInputLayout에 싸여되는 EditText을 가지고 있고 나는 LinearLayouttouchedfragment을 보여주고 싶어요. 그러나 EditTexttouch을 가로 채고 있습니다. 만들기보기 클릭 아닌 EDITTEXT보기

나는 조금의 힌트 color slightly 변경을 제외하고 아무것도하지 않는 EditTextTextInputLayout하지만 지금은 touchfocusable="false"clickable="false"을 설정했습니다.

회색으로 바뀐 style color 변경으로 인해 enabled="false"을 설정하고 싶지 않습니다.

내 XML : 지금은

<LinearLayout 
      android:id="@+id/type_layout" 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="10dp" 
       android:id="@+id/type_input_layout" 
       android:clickable="false" 
       android:focusable="false"> 

       <EditText 
        android:id="@+id/type_input" 
        android:hint="Type" 
        android:text="Public" 
        android:clickable="false" 
        android:focusable="false" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:inputType="textNoSuggestions|textMultiLine" 
        android:background="@color/transparent" 
        android:gravity="left" 
        android:textSize="22sp"/> 

      </android.support.design.widget.TextInputLayout> 

     </LinearLayout> 

내 솔루션 : 단지

답변

0

android:enabled="false"을 시도해보십시오 글고 위에 뷰를 넣어. 확실하지 않지만 작동 할 수도 있습니다.

+1

그렇지 않습니다. 회색이기도합니다. 내가 원하지 않는 모든 것. – nic

0

LinearLayout에서 android:descendantFocusability="blocksDescendants"을 사용해보십시오. 어린이가 포커스를 볼 수 없도록 만듭니다.

가있는 LinearLayout의 모든 아이 뷰 android:duplicateParentState="true"을 시도해보십시오

또한

android:focusable="false" 
android:focusableInTouchMode="false" 

편집 포커스 속성을 모두 사용하여 시도 할 수 있습니다. this question을 볼 수도 있습니다. EditText에 inputType이 클릭을 가로 챌 수 있다고 언급하는 사람이 있습니다.

+0

덕분에, 아무 것도 여기에서 바뀌지 않는 것 같습니다. – nic

+0

EditText는 여전히 포커스 가능합니까? –

+0

edittext는 포커스를 얻을 수 없지만 여전히 트리거 할 LinearLayout의 onClick을 얻을 수 없습니다. – nic

0

이 2 줄 TextInputlayout에서

android:clickable="false" 
android:focusable="false" 

를 제거하여 EDITTEXT에 선형 레이아웃

android:clickable="true" 

세트에서의 작업

설정을 할 수있다,이 시도

android:clickable="false" 
android:focusable="false"