2012-09-28 3 views
1

this 질문을 읽었습니다. 아니, 도움이되지 않았다.ListView에서 전체 목록 항목을 클릭 할 수 없습니다.

문제는 내 ListView 셀의 강조 표시된 영역 만 클릭 할 수 있다는 것입니다. 그것은 텍스트로 채워진 영역입니다. 사진을보세요 : 당신은 동그라미 영역을 클릭 할 때

enter image description here

그래서 -이 응답하지 않을 것입니다.

제대로 작동시키는 방법에 대한 아이디어 ???

편집 : 내 목록 레이아웃 :

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:padding="5dp"> 

    <ImageView 
     android:id="@+id/shoulderLogo" 
     android:layout_width="100dp" 
     android:layout_height="100dp" 
     android:layout_marginLeft="5dp" 
     android:layout_marginRight="20dp" 
     android:layout_marginTop="5dp"> 
    </ImageView> 

    <TextView 
     android:id="@+id/shoulderLabel" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
    </TextView> 

</LinearLayout> 
+0

각 목록 항목에 대해 팽창중인 레이아웃을 표시 할 수 있습니까? – Eric

+0

이미지가 있습니까? 아니면 사용자 정의 된 어댑터와 같은 것을 사용하고 있습니까? xml 레이아웃을 게시 하시겠습니까 –

+0

팽창시키지 않으면 xml 파일의 여백을 제거하려고 시도하십시오 –

답변

4

로 변경 내가 목록 레이아웃있는 LinearLayout은 layout_width의를 가지고 있기 때문입니다 확신 해요 wrap_content. 이렇게하면 행이 포함 된보기의 너비만큼만 표시됩니다. 대신 fill_parent 또는 match_parent으로 설정하면 목록의 너비를 채 웁니다.

+0

만약 내가 TextView 옆에 ImaageView가? Fill_Parent는 그 일을 커버하지 않습니다! – Saqib

2

보십시오이

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:padding="5dp"> 

<ImageView 
    android:id="@+id/shoulderLogo" 
    android:layout_width="wrap_content" 
    android:layout_height="100dp" 
    android:layout_marginLeft="5dp" 
    android:layout_marginRight="20dp" 
    android:layout_marginTop="5dp"> 
</ImageView> 

<TextView 
    android:id="@+id/shoulderLabel" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 
</TextView> 

+0

실례합니다. 당신을 얻지 못했습니다. –

+0

감사합니다. :)하지만 변경 안드로이드 : layout_width = "100dp"ImageView에서 :) – Dennis

+0

귀하의 요구 사항까지 최대 ... –

관련 문제