2013-03-05 4 views
0

그리드보기 항목에 편집 텍스트를 표시하고 싶습니다. 어떤 방식이 궁금GridView의 EditText

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/main_resume_item_layout" 
      android:layout_height="160dip" 
      android:layout_width="150dip"> 

<ImageView 
    android:id="@+id/item_icon" 
    android:layout_height="120dip" 
    android:layout_width="fill_parent" 
    android:src="@drawable/icon" 
    android:layout_gravity="center"/> 

<LinearLayout 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:layout_marginTop="70dip" 
    android:orientation="vertical" 
    android:paddingLeft="30dip" 
    android:background="#FF5" 
    android:paddingRight="10dip"> 

    <TextView 
     android:id="@+id/created" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="Created" 
     android:gravity="center" 
     android:textColor="#000"/> 

    <TextView 
     android:id="@+id/resume_date" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="18.01.2013" 
     android:gravity="center" 
     android:textColor="#000"/> 

    <ProgressBar 
     android:id="@+id/resume_progress" 
     android:layout_width="fill_parent" 
     android:layout_height="6dip" 
     style="@android:style/Widget.ProgressBar.Horizontal" 
     android:max="70" 
     android:progress="50" 
     android:background="@drawable/progress" 
     android:progressDrawable="@drawable/progress"/> 

</LinearLayout> 

<TextView 
    android:id="@+id/resume_title" 
    android:layout_below="@id/item_icon" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Example resume" 
    android:textColor="#5544FF" 
    android:textStyle="bold" 
    android:textSize="18sp" 
    android:gravity="center"/> 

<EditText 
    android:id="@+id/resume_title_edit" 
    android:layout_below="@id/item_icon" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Example resume" 
    android:textColor="#5544FF" 
    android:textStyle="bold" 
    android:textSize="18sp" 
    android:gravity="center" 
    android:inputType="text" 
    android:visibility="invisible"/> 

을 : 문제는 (이 here을 기록 된대로)이 경우의 GridView이

내의 GridView 항목은 다음과 같습니다 대해서 itemClick 이벤트를 처리하지 않는다는 것입니다 GridView에서 EditText가 있고 ItemClick 이벤트를 처리합니까? 어쩌면 누군가가 이것을 해결할 수있는 방법을 알고 있습니까?

답변

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

레이아웃의 edittext를 제외한 다른 모든보기에 이것을 추가하십시오.

또는 어댑터 클래스에서 click 이벤트를 추가 할 수 있습니다.

+0

내가 추가했지만 도움이되지 않습니다. GridView에 대한 OnItemClickListener 여전히 작동하지 않습니다 – Bersh

+0

고마워, 내 어댑터의 레이아웃에 클릭 이벤트를 추가 하여이 문제를 해결 한 것 같아요 – Bersh