所以,我使用 cardview 在我的 android 应用程序的一个页面中创建一个片段页面。我正在使用 cardview 来获得一个整洁的方形布局,但是对于长文本,对于最后一段,它被 1 行截断,而且 layout_marginbottom 似乎也不起作用。发生什么事?
这是我的 fragmentpage.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffffff" >
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_margin="8dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardCornerRadius="0dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ifgf_logo" />
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="25sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Title 1"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="15sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="25sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Title 2"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="15sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="25sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Title 3"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="15sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="25sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Title 4"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_gravity="center_horizontal|center"
android:gravity="center"
android:textSize="15sp"
android:layout_centerInParent="true"
android:textColor="#626262"
android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."/>
</LinearLayout>
</ScrollView>
</android.support.v7.widget.CardView>
</RelativeLayout>
这是我向下滚动之前和向下滚动之后的屏幕截图。顶部正确地有顶部边距,但底部似乎没有任何边距,并且还切断了一些文本。