繁体   English   中英

如何在 CardView 中添加 Horizo​​ntalScroll View

[英]How can i add HorizontalScroll View in CardView

我是 Android 应用程序开发的初学者,我想问关于卡片布局的非常基本的问题,所以我的问题是“如何在 cardView 中添加水平滚动视图:

我的卡片布局 xml 代码如下所示

<?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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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