[英]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.