我看到了有关材料设计指南,但它有点混乱,当我设计我的卡片时,左侧有图像,图像右侧有一些文字。但我不满意它是否符合指南...请检查并告诉。
我还希望我的虚拟文本段落合理。
这是我的代码:-
<android.support.v7.widget.CardView
style="@style/MyCardViewStyle"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<ImageView
android:id="@+id/appImage"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginLeft="16dp"
android:background="@drawable/video"
android:scaleType="centerCrop"
tools:ignore="ContentDescription"/>
<TextView
android:id="@+id/headingText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/appImage"
android:paddingLeft="16sp"
android:paddingRight="16dp"
android:text="Title"
android:textColor="#000"
android:textSize="18sp"
tools:ignore="RtlHardcoded"/>
<TextView
android:id="@+id/subHeaderText"
style="@style/Base.TextAppearance.AppCompat.Subhead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/headingText"
android:layout_toRightOf="@+id/appImage"
android:paddingLeft="16dp"
android:text="SubTiltle"
android:paddingRight="16dp"
android:textColor="#000"
android:textSize="15sp"/>
<TextView
android:id="@+id/subHeadingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/subHeaderText"
android:layout_toRightOf="@+id/appImage"
android:gravity="left"
android:lines="5"
android:maxLines="5"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingTop="16dp"
android:text="@string/stories_detail"
android:textColor="#737078"
android:textSize="14sp"/>
<Button
android:id="@+id/getDealBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/subHeadingText"
android:background="@drawable/get_deal_button"
android:elevation="2dp"
android:textAllCaps="true"
android:textColor="#FFFF"
android:textSize="14sp"
android:textStyle="bold"/>
</RelativeLayout>
and here is my cardview looks like:-
这是link https://github.com/eugenebrusov/cards到 GitHub 项目,其中 CardView 布局是按照 Material Design 指南实现的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)