1

コンテンツ用のカードを使用して、Google のようなインターフェイスを備えたアプリを作成しています。

まず、この画像を見てください: http://imgur.com/oLSSvIn

カードを作成してコンテンツを追加することはできましたが、青い矢印が示すように、imageview がカードの境界線 (影の線) の上に表示されています。

画像ビューの下にカードの灰色の境界線を星にする方法を教えてください。イメージビューにマージンを追加し、カードに下部/上部のパディングを追加しようとしましたが、成功しませんでした。

カード bg のコードは次のとおりです。

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle"
            android:dither="true">

            <corners android:radius="0dp"/>

            <solid android:color="#bdbdbd" />



        </shape>
    </item>

    <item android:bottom="2dp">
        <shape android:shape="rectangle"
            android:dither="true">

            <corners android:radius="0dp" />

            <solid android:color="@android:color/white" />


        </shape>
    </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="wrap_content"
    android:layout_marginBottom="4dp"
    android:layout_marginLeft="6dp"
    android:layout_marginRight="6dp"
    android:layout_marginTop="4dp"
    android:background="@drawable/friend_card_profile_bg" >

    <ImageView
        android:id="@+id/friendPic"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="1dp"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:src="@drawable/friend_testpic" />

    <TextView
        android:id="@+id/friendUsername"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="2dp"
        android:layout_marginLeft="6dp"
        android:layout_marginTop="4dp"
        android:layout_toRightOf="@+id/friendPic"
        android:fontFamily="sans-serif-condensed"
        android:text="@string/profile_username"
        android:textColor="#7f7f7f"
        android:textSize="19dp" />

    <TextView
        android:id="@+id/friendLinksCounter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/friendUsername"
        android:layout_marginLeft="6dp"
        android:layout_toRightOf="@+id/friendPic"
        android:fontFamily="sans-serif"
        android:text="@string/profile_links_counter"
        android:textColor="#acacac"
        android:textSize="14dp" />

    <TextView
        android:id="@+id/friendFriendsCounter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/friendLinksCounter"
        android:layout_marginLeft="6dp"
        android:layout_toRightOf="@+id/friendPic"
        android:fontFamily="sans-serif"
        android:text="@string/profile_friends_counter"
        android:textColor="#acacac"
        android:textSize="14dp" />

</RelativeLayout>

ありがとうございます

4

1 に答える 1