【发布时间】:2017-01-23 10:55:19
【问题描述】:
Android 中是否有任何特定组件,或者我必须使用视图来制作三角形(在图像中显示为圆形)并附加到卡上,但是当我上传图像时,它与图像中的不同。
@ 987654321@
【问题讨论】:
标签: android user-interface view android-recyclerview android-components
Android 中是否有任何特定组件,或者我必须使用视图来制作三角形(在图像中显示为圆形)并附加到卡上,但是当我上传图像时,它与图像中的不同。
@ 987654321@
【问题讨论】:
标签: android user-interface view android-recyclerview android-components
有很多方法,但我的是:
您将在 Photoshop 中创建一个类似的图像(当然要对其进行测量并定位所有设备 (dp)),然后将其放在您的 drawable 文件夹中,并在您的 CardView 之上调用它。
假设图像被称为image_traingle.jpg,你可以这样做
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:onClick="Contract"
android:layout_margin="10dp"
app:cardCornerRadius="7dp"
android:layout_height="90dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Imageview
android:layout_width="wrap_content"
android:gravity="left"
android:background="@color/colorPrimary"
android:src="drawable/image_triangle"
android:layout_height="match_parent" />
.
.
.
</LinearLayout>
</android.support.v7.widget.CardView>
【讨论】: