0

Android のイメージビュー ウィジェットの背景としてレイヤー リストを追加したいと考えています。

android:background="@drawable/layer_list_xmlfile
私はそれを asおよび asとして追加しようとしましandroid:src="@drawable/layer_list_xmlfileた。

レイヤーリストを追加してもプレビューウィンドウには何も表示されず、apkのビルドにも表示されません(genymotionおよび実際のAndroidデバイスで使用されます)。

ここに私が得るものがあります:

エラーアイコンの意味がわからない

レイヤーリストは、プレビュー ウィンドウの赤い点がある位置に表示されるはずです。

私のイメージビューレイアウトコード:

<ImageView android:id="@+id/service_offers"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:src="@drawable/customoffertag"
            android:scaleType="center"
            android:contentDescription="@string/service_offer"/>

私のレイヤーリスト(customoffertag.xml):

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/custom_layer_item">
        <rotate
            android:fromDegrees="-65"
            android:toDegrees="45"
            android:pivotX="-55%"
            android:pivotY="1%" >
            <shape
                android:shape="rectangle" >
                <stroke android:color="@android:color/transparent"
                    android:width="10dp"/>
                <solid
                    android:color="#008475" />
            </shape>
        </rotate>
    </item>
</layer-list>

エラーアイコンが何を示しているのか、どこが間違っているのか、誰か教えてください。

完全なレイアウト コード:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:layout_margin="2dp"
    android:padding="5dp" >

<android.support.v7.widget.CardView
    android:id="@+id/card_list_service"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    card_view:cardCornerRadius="4dp"
    android:padding="5dp"
    android:background="#FFFFFF"
    android:elevation="4dp">

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

        <ImageView android:id="@+id/service_pic"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginRight="3dp"
            android:layout_marginEnd="3dp"
            android:layout_centerVertical="true"
            android:scaleType="fitXY"
            android:contentDescription="@string/item_pic"/>

        <TextView android:id="@+id/service_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toEndOf="@id/service_pic"
            android:layout_toRightOf="@id/service_pic"
            android:layout_alignTop="@id/service_pic"
            android:padding="5dp"
            android:gravity="center"
            android:text="@string/service_provider_name"
            android:textColor="#000000"
            android:textSize="18sp"
            android:textStyle="normal"
            android:typeface="monospace"
            android:layout_marginBottom="2dp"/>

        <ImageView android:id="@+id/pickup_service"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toEndOf="@id/service_text"
            android:layout_toRightOf="@id/service_text"
            android:layout_alignBottom="@id/service_text"
            android:layout_alignParentTop="true"
            android:src="@drawable/pickup"
            android:scaleType="centerCrop"
            android:padding="5dp" />

        <ImageView android:id="@+id/service_offers"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:src="@drawable/customoffertag"
            android:scaleType="center"
            android:contentDescription="@string/service_offer"/>

        <TextView android:id="@+id/service_contact_no"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/service_text"
            android:layout_toRightOf="@id/service_pic"
            android:layout_toEndOf="@id/service_pic"
            android:layout_alignStart="@id/service_text"
            android:layout_alignLeft="@id/service_text"
            android:padding="5dp"
            android:gravity="center"
            android:text="@string/service_provider_contact"
            android:textColor="#848484"
            android:textStyle="normal"
            android:textSize="16sp"
            android:typeface="monospace" />

        <TextView android:id="@+id/service_dist"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/service_contact_no"
            android:layout_toEndOf="@id/service_pic"
            android:layout_toRightOf="@id/service_pic"
            android:layout_alignLeft="@id/service_contact_no"
            android:layout_alignStart="@id/service_contact_no"
            android:padding="5dp"
            android:gravity="center"
            android:text="@string/service_provider_dist"
            android:textColor="#848484"
            android:textSize="15sp"
            android:textStyle="normal"
            android:typeface="monospace"/>

        <Button android:id="@+id/booknow_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/service_contact_no"
            android:layout_toRightOf="@id/service_dist"
            android:layout_toEndOf="@id/service_dist"
            android:layout_alignBottom="@id/service_dist"
            android:padding="5dp"
            android:text="@string/booknow"
            android:textSize="17sp"
            android:textStyle="normal"
            android:textColor="#FFFFFF"
            android:typeface="monospace"
            android:gravity="center"
            android:background="#008475"
            android:elevation="2dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="@string/review_2"
            android:textColor="#848484"
            android:textSize="17sp"
            android:id="@+id/review_text"
            android:layout_centerVertical="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:padding="3dp"
            android:layout_marginEnd="3dp"
            android:layout_marginRight="3dp"
            android:gravity="end" />

        <TextView android:id="@+id/review_text1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="@string/review_1"
            android:textSize="17sp"
            android:textColor="#FFFFFF"
            android:layout_centerVertical="true"
            android:layout_toLeftOf="@id/review_text"
            android:layout_toStartOf="@id/review_text"
            android:layout_alignTop="@id/review_text"
            android:layout_marginRight="0dp"
            android:layout_marginEnd="0dp"
            android:padding="3dp"
            android:background="#424242"/>

    </RelativeLayout>

</android.support.v7.widget.CardView>

4

2 に答える 2