私のScrollView
は一番下までスクロールしません。thisとthisのようないくつかの同様の質問をここで読んでいます。私はの10dpの詰め物の底にを追加しようとしましたが、助けになりませんでした。下の画像は、私の問題はScrollViewは一番下までスクロールしません
見え、下の画像は、見えるようになっている方法です方法を示していますあなたがそこに見ることができるように
(は下パディングを150DP型を追加しました)下の別の項目です。リストに表示されている項目の数は、データベースからフェッチされており、異なることがあるので、私は単にここで
減少/ので、私は増加する必要があるだろう、パディングを下150パディングを維持することはできません私のXMLフラグメント
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/weekDisplayed">
<android.support.percent.PercentRelativeLayout
app:layout_heightPercent="10%"
android:layout_width="match_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:id="@+id/header"
android:background="@drawable/main_calendar_header_menu">
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
app:layout_marginLeftPercent="3%"
android:layout_centerVertical="true"
android:id="@+id/prevIcon"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:background="@mipmap/arrow_left"/>
<TextView
android:text="Placeholder"
android:layout_centerHorizontal="true"
android:id="@+id/periodTextView"
android:layout_centerInParent="true"
android:textSize="17sp"
android:textStyle="bold"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
app:layout_marginRightPercent="3%"
android:layout_centerVertical="true"
android:id="@+id/nextIcon"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="@mipmap/arrow_right"/>
</android.support.percent.PercentRelativeLayout>
<ScrollView
android:id="@+id/scrollView"
android:layout_below="@+id/header"
android:layout_centerHorizontal="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp">
<RelativeLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/daysContainer"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp">
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="@drawable/shadow_middle"
android:layout_below="@+id/daysContainer"
android:id="@+id/shadowMiddle"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/shadowMiddle"
android:id="@+id/summaryContainer"
android:paddingBottom="150dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:id="@+id/commissionSummaryContainer"
android:layout_alignParentTop="true">
</RelativeLayout>
<View
android:layout_height="10dp"
android:layout_width="match_parent"
android:id="@+id/shadowBottom"
android:layout_below="@+id/commissionSummaryContainer"
android:background="@drawable/shadow_middle"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:id="@+id/absenceSummaryContainer"
android:layout_below="@+id/shadowBottom">
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</android.support.percent.PercentRelativeLayout>
@+id/daysContainer
、@+id/commissionSummaryContainer
と@+id/absenceSummaryContainer
のためですが、その子をフェッチし、動的に作成されている図です。
プロパティのalignParentBottom = trueを指定して、RelativeLayout(ScrollViewの子)の中にダミービュー(android.support.v4.widget.Spaceなど)を追加しようとしましたか? –
スクロールビューに 'app:layout_heightPercent =" 90% "'を与えてみてください –
相対レイアウトを使用する代わりにPercentRelativeLayoutを使用してください。 – nnn