0

私はアンドロイドの初心者です。データベースを正しく読み取っていて、アプリケーションは正常に機能していますが、問題は、データベースから読み取るときに、一部のページのコンテンツが互いに重複していることです。最初はレイアウトに問題があると思い、巨大なデータを使って適切に機能していることを確認しました。

![ここに画像の説明を入力してください] [1]どこで修正すればよいのか、誰か教えてください。
[スクリーンショットを投稿しようとして申し訳ありませんが、stackoverflowで10レピュテーションを言うことができません]

これがレイアウトのコードです

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android1="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#2a2a2a"
    android:fillViewport="true" >

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:baselineAligned="true"
    android:orientation="vertical"
     >
<!-- Child linear layout with horizontal orientation -->
  <LinearLayout android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
              android:orientation="horizontal" android:background="#2a2a2a"
              android:layout_marginTop="25dip">



    </LinearLayout>

    <TextView
        android:id="@+id/textView00"
        android:layout_width="wrap_content"
        android:layout_height="37dp"
        android:text="TextView"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/textView01"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_weight="0.13"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceSmall" />

     <TextView
        android:id="@+id/textView02"
        android:layout_width="wrap_content"
        android:layout_height="37dp"
        android:text="TextView" 
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <TextView
        android:id="@+id/textView03"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_weight="0.13"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <TextView
        android:id="@+id/textView04"
        android:layout_width="wrap_content"
        android:layout_height="37dp"
        android:text="TextView" 
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <TextView
        android:id="@+id/textView05"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.13"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
        android:id="@+id/textView06"
        android:layout_width="wrap_content"
        android:layout_height="37dp"
        android:text="TextView" 
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <TextView
        android:id="@+id/textView07"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.13"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
        android:id="@+id/textView08"
        android:layout_width="wrap_content"
        android:layout_height="37dp"
        android:text="TextView" 
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <TextView
        android:id="@+id/textView09"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_weight="0.13"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
        android:id="@+id/textView10"
        android:layout_width="wrap_content"
        android:layout_height="37dp"
        android:text="TextView" 
        android:textAppearance="?android:attr/textAppearanceMedium"/>

    <TextView
        android:id="@+id/textView11"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_weight="0.13"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceSmall" />

</LinearLayout>

</ScrollView>

.................................................。 .......................................ありがとうございました。 .....。

4

1 に答える 1

1

これは、すべてのTextViewlayout_heightに「match_parent」を設定したためだと思います。それらを「wrap_content」に変更して、再試行してください。

于 2012-12-19T19:21:20.943 に答える