当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Google Play Store Cardview

问题描述:

I have been trying for a long time to make Cards similar to appearance that of Google Play Store, ie cards of Different sizes , with images and all inside the card. Any tips on how to proceed.

网友答案:

Basically you just create a layout (RelativeLayout, LinearLayout, etc) as a child of your cardview element and make it look however you want. For example...

<android.support.v7.widget.CardView
    android:layout_gravity="center"
    android:layout_width="200dp"
    android:layout_height="200dp"
    card_view:cardElevation="2dp"
    card_view:cardBackgroundColor="@android:color/white"
    card_view:cardCornerRadius="2dp">

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

        //Your desired layout here    

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

You can take a look at the MaterialList implementations for some good examples.

分享给朋友:
您可能感兴趣的文章:
随机阅读: