我想實現一個簡單的屏幕,在這裏我有書的條目水平滾動視圖。我遇到的問題是,它似乎過早切斷,切斷條目。我已經看過類似這樣的其他問題,以及它們的補丁似乎並沒有解決我的,所以我不知道如何處理這個問題。線性佈局還是水平滾動查看被切斷內容
這裏是什麼切斷的樣子:
這裏是我的代碼:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#D3D3D3" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:orientation="vertical" >
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:text="@string/af"
android:textAppearance="?android:attr/textAppearanceLarge" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#A1A1A1" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal|end"
android:orientation="horizontal" >
<RelativeLayout
android:id="@+id/relative1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="168dp"
android:layout_height="258dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:contentDescription="@string/cd"
android:src="@drawable/af1" />
<TextView
android:id="@+id/textLabel1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageView1"
android:layout_centerInParent="true"
android:singleLine="true"
android:text="Guilty Wives" />
</RelativeLayout>
/*RelativeLayout repeats with different data, cut for brevity*/
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
</ScrollView>
我還搜查多個問題,在這裏對於這個問題,尋找解決方案是多麼容易:http://stackoverflow.com/a/12181589/2311557 :) – codepleb