滚动cardview不起作用

编程入门 行业动态 更新时间:2024-10-28 20:28:48
本文介绍了滚动cardview不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是android应用程序开发的新手.我在android-studio中制作一个项目.我想列出将滑动的cardview.如果有人知道答案,请也分享您的答案和xml代码.我的xml代码在下面

I am new in android app development. I am making a project in android-studio. I want to list of cardview that will slide. If anyone knows the answer,please share your answer and xml code too.My xml code is below

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="schemas.android/apk/res/android" xmlns:app="schemas.android/apk/res-auto" xmlns:tools="schemas.android/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/images" tools:context="litifer.awesome.game.cardview.MainActivity" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView1" android:layout_gravity="center" android:layout_marginTop="20dp" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" app:cardCornerRadius="5dp" app:cardElevation="5dp" android:clickable="true" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView1Text" android:text="Get in Touch" android:textSize="20dp" android:paddingTop="40dp" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView1Edit" android:hint="Enter Email here" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/cardView1Button" android:text="Submit" android:layout_gravity="center" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingBottom="40dp"/> </LinearLayout> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:id="@+id/cardView2" android:layout_gravity="center" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" app:cardCornerRadius="5dp" app:cardElevation="5dp" android:clickable="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView2Text" android:text="Bluetooth demo" android:textSize="20dp" android:paddingTop="20dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView1Text1" android:text="Send Notification when in Bluetooth range" android:textSize="20dp" android:clickable="true" android:paddingBottom="40dp"/> </LinearLayout> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:id="@+id/cardView3" android:layout_gravity="center" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" app:cardCornerRadius="5dp" app:cardElevation="5dp" android:clickable="true" android:paddingTop="40dp" android:paddingBottom="40dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView3Text" android:text="Wifi Demo" android:textSize="20dp" android:paddingTop="40dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView3Text1" android:text="Send Notification when in Wifi range" android:textSize="20dp" android:paddingBottom="40dp"/> </LinearLayout> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView4" android:layout_marginTop="10dp" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" app:cardCornerRadius="5dp" app:cardElevation="5dp" android:layout_gravity="center" android:clickable="true" android:paddingTop="40dp" android:paddingBottom="40dp" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView4Text" android:text="Review Demo" android:textSize="20dp" android:paddingTop="40dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/cardView4Text1" android:text="Get Customer Reviews using beacons" android:textSize="20dp" android:paddingBottom="40dp"/> </LinearLayout> </android.support.v7.widget.CardView></LinearLayout>

推荐答案

查找解决方案

<ScrollView xmlns:android="schemas.android/apk/res/android" xmlns:app="schemas.android/apk/res-auto" xmlns:tools="schemas.android/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewReport="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/images" tools:context="litifer.awesome.game.cardview.MainActivity"> //----------- //----------- </LinearLayout> </ScrollView>

更多推荐

滚动cardview不起作用

本文发布于:2023-11-03 01:01:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1553856.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   cardview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!