Мое приложение извлекает данные пользователя из БД и отображает их в ListView. Однако содержимое, отображаемое в ListView, не отформатировано должным образом.Содержание в ListView не сосредоточено
Это как мой макет в настоящее время оказывается:
Это мой файл макета для деятельности:
<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:background="#000000"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
tools:context=".LeaderBoard" >
<LinearLayout
android:id="@+id/column"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/column_header1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="@string/strLBoardHeaderRank"
android:textColor="#f00"
android:textSize="24sp" />
<TextView
android:id="@+id/column_header2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:text="@string/strLBoardHeaderName"
android:layout_gravity="center"
android:textColor="#f00"
android:textSize="24sp" />
<TextView
android:id="@+id/column_header3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="@string/strLBoardHeaderScore"
android:textColor="#f00"
android:textSize="24sp" />
</LinearLayout>
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/column" >
</ListView>
</RelativeLayout>
Файл макета для списка активности ниже:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000" >
<TextView
android:id="@+id/rank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:textColor="#f00"
android:textSize="20sp" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.6"
android:textColor="#f00"
android:textSize="20sp" />
<TextView
android:id="@+id/score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:textColor="#f00"
android:textSize="20sp" />
</LinearLayout>
Спасибо. Это сработало. – webgenius
u приветствую ... :) –