【问题标题】:How can I attach this triangle with cardview in Android?如何在 Android 中使用 cardview 附加这个三角形?
【发布时间】:2017-01-23 10:55:19
【问题描述】:

Android 中是否有任何特定组件,或者我必须使用视图来制作三角形(在图像中显示为圆形)并附加到卡上,但是当我上传图像时,它与图像中的不同。
@ 987654321@

【问题讨论】:

    标签: android user-interface view android-recyclerview android-components


    【解决方案1】:

    有很多方法,但我的是:

    您将在 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>
    

    【讨论】:

    • 感谢您的回复。但是android中有一个名为extra detail的组件,我忘记了自最近两天以来我正在搜索的确切名称,但我无法找到。我会尝试这种方法@LuttayaHuzaifahIdris。
    • 好的@kuldeepzala,如果你不介意,你可以给我打勾
    • 我一定会的 :) @LuttayaHuzaifahIdris
    • @kuldeepzala 你介意告诉我你是如何进行的吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-09
    • 1970-01-01
    • 2016-04-04
    • 2015-06-22
    相关资源
    最近更新 更多