简体   繁体   中英

How can i add HorizontalScroll View in CardView

I Am beginner with Android App Development and I want to ask very basic question regarding to the card layout so my question is that "How i can add horizontal scroll view in cardView:

My card layout xml code as given below

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:id="@+id/card_view"
cardCornerRadius="12dp"
xmlns="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android" >



<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clickable="false"
    android:orientation="vertical"
    android:padding="12dp">

    <ImageView
        android:layout_width="350dp"
        android:layout_height="150dp"
        android:elevation="12dp"
        android:src="@mipmap/ic_mob1"
        tools:ignore="ContentDescription,UnusedAttribute" />

    <TextView
        android:textColor="#e4000000"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Case for Samsung galaxy C7 pro"
        android:textSize="20sp"
        tools:ignore="HardcodedText" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Rupee:445"
        android:textSize="18sp"
        tools:ignore="HardcodedText" />

    <RatingBar
        android:id="@+id/ratingBar2"
        android:layout_width="157dp"
        android:layout_height="wrap_content" />


</LinearLayout>

first of recycalview are use..
then 
recycalview adpater xml file in this xml code are used...

<Linearlayout>
// linear oriantation are horizontal
     <android.support.v7.widget.CardView>

     </android.support.v7.widget.CardView>

</Linearlayout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM