【发布时间】:2014-08-12 12:36:22
【问题描述】:
我正在使用新的 Android L SDK,但我不知道如何实现 CardView。好像我错过了什么 - 任何建议都非常感谢!
到目前为止,我在活动中声明了以下内容:
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_below="@+id/waitingHeader"
card_view:cardCornerRadius="4dp">
<LinearLayout
android:id="@+id/card_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/notificationText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="hello"/>
<TextView
android:id="@+id/notificationTex"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="hello2"/>
</LinearLayout>
</android.support.v7.widget.CardView>
我天真地希望这会给我两张带有 hello 和 hello2 的卡片,但我看到的只是一张带有 hello 的卡片 -第二张卡不见了。如何使用 CardView 创建多张卡片?
【问题讨论】:
标签: android android-5.0-lollipop android-cardview