2014-11-05 4 views
0

안드로이드 애플리케이션의 사용자 정의리스트 아이템으로 listview를 구현했습니다. 내가 원하는 것은 장치의 화면 크기가 너비가 작을 때 목록 항목의 구성 요소/내용이 MSWord의 줄 바꿈 텍스트와 비슷한 목록 항목의 높이를 높이는 방향으로 이동해야한다는 것입니다. 이것은 현재 내 응용 프로그램에서 일어나지 않습니다. 커스텀 listitem 레이아웃 레이아웃에서 무엇을 할 수 있습니까? 안드로이드리스트 뷰

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content"> 

<de.hdodenhof.circleimageview.CircleImageView 
    android:id="@+id/shared_mood_item_image" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/default_profile_pic" 
    android:layout_centerVertical="true" 
    android:layout_margin="@dimen/margin"/> 

    <LinearLayout 
    android:id="@+id/linear_l_1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_toRightOf="@+id/shared_mood_item_image" 
    android:layout_toEndOf="@+id/shared_mood_item_image" 
    android:layout_centerVertical="true" 
    android:orientation="vertical"> 

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

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

    </LinearLayout> 

    <LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" 
    android:layout_centerVertical="true" 
    android:gravity="center" 
    android:layout_toRightOf="@+id/linear_l_1" 
    android:layout_toEndOf="@+id/linear_l_1" 
    android:orientation="vertical"> 

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

    <Switch 
     android:id="@+id/switch_1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:focusable="false"/> 
</LinearLayout> 
가 사전에 감사합니다

다음은 내 목록보기의 행 항목의 내 현재 레이아웃입니다.

답변

0

wrap_content 대신 선형 레이아웃 prams에서 너비로 "match_parent"를 사용해야합니다.

UPDATE 또한 폭 매개 변수로 다른 모든 뷰 match_parent에 사용해야합니다.

+0

의견을 보내 주셔서 감사합니다. 하지만 문제가 있다고 생각합니다. 나는 다른 화면에 다른 이미지를 사용하지 않았습니다. 작은 이미지는 내 listview를 좋아 보이게 만들었습니다. 이것은 내 질문에 대한 대답이 아니지만 내 목적을 해결. –

0

값으로 특정 텍스트 크기 (dimens.xml)를 정의하고 다른 장치마다 다른 레이아웃을 만들면됩니다.