所以我有一个ScrollView作为我的布局中的最高级别...在我的ScrollView内部,我有一个RelativeLayout,其中包含其他视图。问题是RelativeLayout没有像应该那样覆盖整个布局,它在大约半个屏幕处被截断。它的宽度是屏幕的全部宽度,但RelativeLayout的高度停在ImageView底部。这是我的布局代码:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="@drawable/graybck">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="@+id/pPicture"
android:layout_width="200dip"
android:layout_height="300dip"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
<TextView
android:id="@+id/pName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="29dp"
android:layout_toRightOf="@+id/pPicture"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/pBio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/pName"
android:layout_below="@+id/pName"
android:layout_marginTop="22dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/stats"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/pName"
android:layout_marginRight="266dp"
android:text="Loading Stats..." />
</RelativeLayout>
</ScrollView>
非常感谢您的帮助!