0

사용자가 textinputlayout을 편집 할 수 없도록 만들고 싶습니다. 사용자가이를 클릭하면 작업을 수행하려고합니다. 을 편집 텍스트로 편집 할 수 없도록 textinputlayout에 추가했지만 지금 클릭하면 textinputlayout의 onclicklistener에 콜백이 전달되지 않습니다.textinputlayout을 편집 할 수 없게 만들고 그것에 클릭 이벤트 설정

<android.support.design.widget.TextInputLayout 
     android:id="@+id/tipVideoFilePath" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignBottom="@+id/uploadVideo" 
     android:layout_toLeftOf="@+id/uploadVideo"> 

    <EditText 
     android:id="@+id/etVideoFilePath" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:paddingLeft="@dimen/dp5" 
     android:singleLine="true" 
     android:focusable="false" 
     android:hint="@string/videoPath" 
     android:textColor="@color/black"/> 
</android.support.design.widget.TextInputLayout> 

답변

3

이러한

edittext.setFocusable(false); 
edittext.setClickable(true); 
2

이 코드를하려고 시도 할 수 있습니다. edittext에 대한 clck 수신기를 사용하십시오.

<android.support.design.widget.TextInputLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"> 

        <EditText 
         android:id="+id/etVideoFilePat" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:focusable="false" 
         android:clickable="true" /> 
</android.support.design.widget.TextInputLayout> 
0

또는이 :

다른 레이아웃 (RaltiveLayout)에 EditText을 넣어 EditTextMatch_Parent

edittext.setFocusable(false); 
edittext.setClickable(false); 

relativelayout.setFocusable(true); 
relativelayout.setClickable(true); 

이 RelativeLayout의

에 OnClickListener를 적용,