0

2 番目の相対レイアウトにエラーがあります

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#FFFFFF"
        android:orientation="vertical" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:padding="5dip"
            **android:xmlns:android="http://schemas.android.com/apk/res/android">**

            <LinearLayout
                android:id="@+id/thumbnail"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_marginRight="5dip"
                android:background="@drawable/image_bg"
                android:padding="3dip" >

                <ImageView
                    android:id="@+id/place_thumbnail"
                    android:layout_width="70dip"
                    android:layout_height="70dip"
                    android:src="@drawable/progressbar" />
            </LinearLayout>

            <TextView
                android:id="@+id/distance"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/thumbnail"
                android:layout_alignParentRight="true"
                android:gravity="right"
                android:textColor="#10bcc9"
                android:textSize="14dip"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/adress"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_toRightOf="@+id/thumbnail"
                android:textColor="#343434"
                android:textSize="14sp" />

            <TextView
                android:id="@+id/name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/thumbnail"
                android:layout_toRightOf="@+id/thumbnail"
                android:textColor="#040404"
                android:textSize="15sp"
                android:textStyle="bold"
                android:typeface="sans" />
        </RelativeLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="phone    :"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#040404"
                android:textSize="20sp" />

            <TextView
                android:id="@+id/phone"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#040404"
                android:textSize="20sp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="website  :"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#040404"
                android:textSize="20sp" />

            <TextView
                android:id="@+id/website"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:autoLink="web"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#040404"
                android:textSize="16sp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="rating    :"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#040404"
                android:textSize="20sp" />

            <RatingBar
                android:id="@+id/ratingBar1"
                style="?android:attr/ratingBarStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:rating="0" />
        </LinearLayout>

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dip" >

            <ImageButton
                android:id="@+id/imageButton1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:src="@android:drawable/ic_menu_call" />

            <ImageButton
                android:id="@+id/imageButton2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:src="@android:drawable/ic_menu_directions" />

            <ImageButton
                android:id="@+id/imageButton3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:src="@android:drawable/ic_menu_compass" />
        </RelativeLayout>

        <Gallery
            android:id="@+id/gallery1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

    </LinearLayout>

同じ問題の古い投稿を確認しましたが、類似のケースは見つかりませんでした。正しい形式と、この問題が発生する可能性を見つける必要があります。

4

2 に答える 2

1

初め:

を取り除き**android:xmlns:android="http://schemas.android.com/apk/res/android">**ます。これを宣言する必要があるのは、すべてのドキュメントで 1 回だけです。また、間違った方法でコメントアウトしました。<!--とを使用して、-->コードをコメントアウトします。

2番:

style="?android:attr/ratingBarStyleSmall"

次のようにする必要があります。

style="@android:attr/ratingBarStyleSmall"

于 2013-09-27T20:11:52.053 に答える
0

あなたの問題は、RelativeLayout の最後の行の前後にある 2 つのアスタリスク (*) だと思います。

削除し**android:xmlns:android="http://schemas.android.com/apk/res/android">**ます。とにかく、LinearLayout で既に名前空間を宣言しているので、この行は必要ありません。

于 2013-09-27T20:11:36.107 に答える