ListView
및 을 포함하는이 XML 레이아웃을 가지고 있지만 CardView
내용이 때때로 화면 아래에 숨겨져 있기 때문에 전체 레이아웃에 스크롤을 적용하고 싶습니다.카드보기에서 안드로이드 스크롤
<?xml version="1.0" encoding="utf-8" ?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical"
android:weightSum="2">
<include
android:id="@id/tool"
layout="@layout/toolbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ListView
android:id="@+id/lvcontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_below="@+id/toolbar"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp" />
<android.support.v7.widget.CardView
android:id="@+id/cardView3"
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_below="@+id/lvcontent"
android:layout_margin="16dp"
android:layout_weight="0.2"
app:layout_anchorGravity="bottom"
card_view:cardCornerRadius="4dp"
card_view:contentPadding="8dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvcusttest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="What Customers are Saying"
android:textColor="#000"
android:textSize="16dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/tvcusttest"
android:background="@android:color/darker_gray"
android:paddingLeft="3dp"
android:paddingRight="3dp" />
</RelativeLayout>
<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/cpiBanner"
android:layout_width="fill_parent"
android:layout_height="15dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="7dp"
android:layout_marginTop="15dp"
android:padding="1dp"
app:fillColor="#ffffff"
app:pageColor="#80cccccc" />
<android.support.v4.view.ViewPager
android:id="@+id/vpCustomerTestimonials"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.v7.widget.CardView>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="30dp"
android:layout_weight="1"></View>
<LinearLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="61dp"
android:layout_alignParentBottom="true"
android:layout_below="@+id/cardView3"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="1">
<Button
android:id="@+id/btnviewcart"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_weight="0.5"
android:background="@color/selecteditem"
android:text="View Cart"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="#ffffff"
android:textSize="23sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
무엇이 잘못 되었나요? 화면 크기가 작 으면 절반 레이아웃이 화면 아래에 숨겨집니다. 난 그냥 스크롤 동작을 적용하는 것입니다. 나는 너에게 매우 감사 할 것이다.
레이아웃을 스크롤보기에 배치하고 목록보기 대신 recyclerview를 사용하면 문제가 해결 될 수 있습니다. 만약 당신이 목록보기 자체를 사용하고 있다면 당신은 스크롤을 처리하고 스크롤 뷰를 별도로 처리해야한다. – Nivedh
listview 자체를 사용해야하는데, 그에 따라 – neha
을 추천한다. 선형 뷰 위에 scrollview를 놓으면리스트 뷰만 스크롤한다. 그리고 카드보기 contetn 여전히 화면 아래에 숨어 – neha