2011-11-19 4 views
0

ImageView에 문제가 있습니다. 항상 ListView에 마지막 아이콘이 항상 큰 경우를 제외하고는 아이콘이 모두 정확한 크기로 표시됩니다.이미지 뷰, 마지막 이미지는 항상 더 크다

아무도 도와 줄 수 있습니까? 다음과 같이 내가 이미지 뷰를 변경하는 경우

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" > 

<ImageView 
    android:id="@+id/imgIcon"   
    android:layout_width="wrap_content"   
    android:layout_height="fill_parent"   
    android:layout_marginRight="6dip"   
    android:src="@drawable/icon" 
    android:gravity="center_vertical" /> 


<TextView android:id="@+id/naam" 
    android:textSize="14sp" 
    android:textStyle="bold" 
    android:textColor="#FFFF00" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"/> 

<TextView android:id="@+id/waarde" 
    android:textColor="#ffffffff" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_toRightOf="@+id/naam" 
    android:layout_marginLeft="2dip"/> 

</LinearLayout> 

, 괜찮아요하지만 너무 큰 :

android:layout_height="wrap_content" 

편집 : 문제 해결, 내가 TextViews

+0

자세한 내용. textView 텍스트 길이 또는 imageView 이미지 크기가 더 크기 때문에 마지막 뷰가 가능합니다. –

답변

0

에 TEXTSIZE을 줄이기 위해 필요한이 당신입니다 항목 레이아웃을 나열 하시겠습니까? 귀하의 이미지 뷰에

android:layout_height="fill_parent" 

그것을 무엇을하고 있는지 아마 - 그것의 뷰 계층의 어딘가에 이상을 지정하지 않을 경우 가능성이 어딘가에, 그렇지 않으면 fill_parent는 높이를 밀어 수있는 높이를 수정해야 - 일반적으로 내가 높이를 수정 목록 항목 루트 요소

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="50dp" 
android:orientation="horizontal" > 

또는 항목 높이가 무엇이든지간에.

+0

대답을위한 Thx 그러나 그 트릭을하지 않습니다. – Lars

+0

유전자가 나는이 ID가 fill_parent 인 뷰 자식과 랩 내용 인 prent가있을 때이 문제가 발생한다고 생각합니다. 불규칙한 크기 조정이 발생합니다. 어쨌든 그건 내 제안이야. – siliconeagle

관련 문제