回答

0

那麼有許多方法,但是我的是:

您將創建一樣,在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> 
+0

感謝答覆。但在android中有一個組件叫做額外的細節,我忘記了自從我過去兩天以來搜索的確切名稱,但我無法找到。我會嘗試這種方法@LuttayaHuzaifahIdris。 –

+0

好吧@kuldeepzala,如果你不介意,你可以給我一個Tick –

+0

當然我會:) @LuttayaHuzaifahIdris –

相關問題