0

これを ListView の代わりに Table を使用するように切り替えますが、これらの項目は提供された XML を指定する必要があるため、これらの項目が相対的ではないことが懸念されます。

問題を引き起こしている Linear の内部にある RelativeLayout について何かありますか?

ここに画像の説明を入力

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

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">

    <ViewSwitcher
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/dashboardViewSwitcher" android:layout_gravity="center">
        <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
            <include
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    layout="@layout/loading" />
        </RelativeLayout>
        <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

            <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/dashboardActivity_Header"
                    android:id="@+id/dashboardActivityHeader"/>
            <ListView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/dashboardActivityList"/>

            <TextView android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="@string/dashboardNews_Header"
                      android:id="@+id/dasboardNewsHeader"/>
            <ListView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/dashboardNewsList"/>
        </RelativeLayout>
    </ViewSwitcher>
</LinearLayout>
4

1 に答える 1

4

、などを使用して、コンポーネントがレイアウト内で何に対して相対的であるかを宣言する必要があります。android:layout_belowandroid:layout_toLeftOf

例えば:

    <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/dashboardActivity_Header"
                android:id="@+id/dashboardActivityHeader"/>
        <ListView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/dashboardActivityHeader"
                android:id="@+id/dashboardActivityList"/>

       </RelativeLayout>
于 2013-01-15T22:06:44.087 に答える