2014-09-08 2 views
1

안드로이드 목록보기 화면에서 여러 데이터를 표시하려고하지만 데이터가 올바른 열에 표시되는 대신 열의 행을 끊어 버리는 문제가 있습니다. 여기 안드로이드 목록보기에서 여러 데이터를 표시하려고합니다.

<ListView 
    android:id="@+id/listView" 
    android:layout_width="wrap_content" 
    android:layout_height="fill_parent" 
    android:layout_centerInParent="true" 
    android:choiceMode="singleChoice" 
    android:textAlignment="center"/> 

</RelativeLayout> 

행을 정의하는 방법이다 : 여기 내 XML입니다 같은 열에도 올라 오지 화면에

<?xml version="1.0" encoding="utf-8"?> 
<!-- row.xml --> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:paddingTop="4dip" 
    android:paddingBottom="6dip" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:layout_gravity="center"> 



    <TextView android:id="@+id/FROM_CELL" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:gravity="right"/> 

    <TextView android:id="@+id/FROMTIME_CELL" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:gravity="right"/> 

    <TextView android:id="@+id/TOTIME_CELL" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:gravity="right"/> 

    <TextView android:id="@+id/TITLE_CELL" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:gravity="right" 
     android:layout_weight="1"/> 

</LinearLayout> 

서로 다른 열을하지만만큼 오른쪽으로 이동된다 그 이전 열에있는 데이터의 정확한 길이. 이 문제를 처리하는 방법을 알려주세요. 사전 :

+0

여기에 스크린 샷을 추가 할 수없는 것 같아 가능성이 있는지 알려 주시기 바랍니다. – cbandroid

+0

tinypic 또는 어딘가에 업로드해야합니다 :) –

+0

@cbandroid 나는 당신을 도울 것입니다 시도해보십시오 ... :) – Umair

답변

0

이 그것을 잘 작동합니다 시도에서 감사합니다 ...

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

<TextView 
android:id="@+id/txt_userName" 
android:layout_width="0dp" 
android:layout_height="19dp" 
android:layout_weight="2" 
android:gravity="center" /> 

<TextView 
android:id="@+id/txt_fName" 
android:layout_width="0dp" 
android:layout_height="19dp" 
android:layout_weight="2" /> 

<TextView 
android:id="@+id/txt_lName" 
android:layout_width="0dp" 
android:layout_height="19dp" 
android:layout_weight="3.51" 
android:gravity="left" /> 

</LinearLayout> 

와 두 번째 XML에

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

<View 
android:id="@+id/a" 
android:layout_width="match_parent" 
android:layout_height="0dp" 
android:paddingBottom="10dp" /> 

<ListView 
android:id="@+id/List" 
android:layout_width="match_parent" 
android:layout_height="match_parent" /> 

</RelativeLayout> 

그것이 hepls 희망이 코드를 시도 ....

+0

감사합니다,이 방법은 나를 위해 작동합니다 :-) – cbandroid

+0

@cbandroid 당신은 그것을 받아 들일 수 있습니까? 대답과 upvote 다른 사람도 도움과 나도 얻을 수 있도록하시기 바랍니다 :) :) – Umair

+0

나는 그것을 받아 들였지만, 충분한 평판을 가지고 있지 않기 때문에 나는 투표 할 수 없다. 왜냐하면 내가 여기 새로 왔기 때문이다. 그것에 대해 미안 해요 :) – cbandroid

관련 문제