layout.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="match_parent"
android:orientation="vertical" >
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/itemlist"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/itemlistbg"
android:gravity="center_vertical"
android:orientation="horizontal"/>
</HorizontalScrollView>
</LinearLayout>
我加入孩子线性布局ID itemlist
动态。如果项目太多,那么结果是好的。但是如果列表中有2个项目,则线性布局itemlist
在最后留下空格。 this only happens on big screen devices
。
eclipse preview of xml http://i43.tinypic.com/ohvgg3.png
图像是xml的eclipse预览。 –