3

したがって、レイアウトの最上位レベルとして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>

どんな助けでも大歓迎です!

4

2 に答える 2

7
<Scrollview> 
    <LinearLayout>
        <RelativeLayout>
        inner part here ...
        </RelativeLayout>
    </LinearLayout>  
</Scrollview>

そのようなものを使ってみてください。

于 2013-02-16T07:04:31.590 に答える
1
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
于 2013-04-09T00:20:35.270 に答える