0
我正在为我的应用程序设计UI。我正在使用Android CardView来包含按钮和文本以及滚动视图。当我向下滚动时,看不到CardView的底部,卡的底部被导航键略微切断。Android CardView的底部被导航按钮阻止
下面是我的意思
也是一个例子,这里是我的布局XML代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<ScrollView
android:layout_width="match_parent"
android:scrollbars="none"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollIndicators="none"
android:layout_margin="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:layout_width="wrap_content"
android:layout_height="300dp"
android:text="New Button"
android:id="@+id/button"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="300dp"
android:text="New Button"
android:id="@+id/button2"
android:layout_below="@+id/button"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="300dp"
android:text="New Button"
android:id="@+id/button3"
android:layout_below="@+id/button2"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/textView"
android:layout_below="@+id/button2"
android:layout_centerHorizontal="true"
android:layout_marginTop="300dp"
android:textColor="#4b1313" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:layout_width="wrap_content"
android:layout_height="300dp"
android:text="New Button"
android:id="@+id/button4"
android:layout_below="@+id/button6"
android:layout_alignLeft="@+id/button5"
android:layout_alignStart="@+id/button5" />
<Button
android:layout_width="wrap_content"
android:layout_height="300dp"
android:text="New Button"
android:id="@+id/button5"
android:layout_below="@+id/button4"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="300dp"
android:text="New Button"
android:id="@+id/button6"
android:layout_alignParentTop="true"
android:layout_alignLeft="@+id/button4"
android:layout_alignStart="@+id/button4" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</ScrollView>
似乎并没有解决这个问题,什么都没有改变,当我把它添加到主布局 – Michael
给予填充,然后 – Dayvon