【发布时间】:2015-10-03 06:21:56
【问题描述】:
我正在尝试在我的活动中将卡片尺寸设置得更小,但不确定如何因为它是如何引用它的(card:card_layout_resourceID="@layout/card_thumbnail_layout")。
所以我的问题是如何使用这个库但改变下面卡片的高度?
这是一张卡片
<it.gmariotti.cardslib.library.view.CardView
android:id="@+id/carddemo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card:card_layout_resourceID="@layout/card_thumbnail_layout"
android:layout_below="@+id/currentTerm"
/>
@layout/card_thumbnail_layout:(无法编辑,因为它在构建文件夹中)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Card visible layout -->
<LinearLayout
android:id="@+id/card_main_layout"
style="@style/card.main_layout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<!-- Compound view for Header Card
If you want to customize this element use attr card:card_header_layout_resourceID
You can also use your CardHeader subclass-->
<it.gmariotti.cardslib.library.view.component.CardHeaderView
style="@style/card.header_outer_layout"
android:id="@+id/card_header_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/card_thumb_and_content_layout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<it.gmariotti.cardslib.library.view.component.CardThumbnailView
style="@style/card_thumbnail_outer_layout"
android:id="@+id/card_thumbnail_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<!-- Main Content View -->
<FrameLayout
android:id="@+id/card_main_content_layout"
style="@style/card.content_outer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</LinearLayout>
<!-- Compound view for Shadow
If you want to customize this element use attr card:card_shadow_layout_resourceID -->
<it.gmariotti.cardslib.library.view.component.CardShadowView
style="@style/card.shadow_outer_layout"
android:id="@+id/card_shadow_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<!-- Expand layout. You can customize this element with your CardExpand class -->
<FrameLayout
android:id="@+id/card_content_expand_layout"
style="@style/card.main_contentExpand"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</FrameLayout>
</LinearLayout>
【问题讨论】:
标签: android