Is it possible to make ListView cards like this?

enter image description here

    2 answers 2

    use the CardView widget as an item list

     <android.support.v7.widget.CardView android:id="@+id/card" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FEFEFE" android:layout_margin="8dp" app:cardCornerRadius="4dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="centerCrop"/> <TextView android:id="@+id/text_header" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </android.support.v7.widget.CardView> 

    Layout the inside of the item, build yourself as you need, this is just an example. You will also need a custom adapter to bind the data to this site.

      In short, there are many ways, depending on the version. For example, with Android 6.0 (if memory serves) CardView is added. If versions are younger, you can use anything from canvas to GridView.

      PS In general, here is an example about which it is

      http://www.fandroid.info/primer-ispolzovaniya-cardview-i-recyclerview-v-android

      and here sorts

      https://github.com/tutsplus/Android-CardViewRecyclerView

      • 2
        Cards, if I am not mistaken, were presented by Google along with the material design. That was before the release of the 5 android. For younger versions of CardView is in support-v7 lib. Neither the canvas nor the GridView will be required. In the reference example about RecyclerView , and the question about ListView is YuriySPb