【发布时间】:2014-07-24 15:33:15
【问题描述】:
我的这个布局不能正常工作,因为没有显示水平滚动视图: 基本上在第一个容器中有两个子布局,第一个是固定的,第二个应该水平滚动,但第二个没有出现。
@drawable/disattivato 包含:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#333333"
android:endColor="#000000"
android:type="radial"
android:gradientRadius="500"/>
<stroke
android:dashGap="10px"
android:dashWidth="10px"
android:width="1dp"
android:color="#ababb2" />
</shape>
这是我的布局:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="8" >
<TextView
android:id="@+id/tv1"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="@drawable/backgroundbutton"
android:gravity="center"
android:text="kick11"
android:textColor="#000000"
android:textSize="8pt"
android:textStyle="bold" />
other textviews...
</LinearLayout>
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="8" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:orientation="horizontal" >
<ImageView
android:id="@+id/im11"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:adjustViewBounds="false"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im12"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im13"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im14"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im15"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im16"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im17"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im18"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im19"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im110"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im111"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im112"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im113"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im114"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im115"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/im116"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/buf"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/buf1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/buf2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/buf3"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/buf4"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/buf5"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/disattivato"
android:scaleType="fitXY" />
</LinearLayout>
other linear layouts with the same exactly structure
</LinearLayout>
</HorizontalScrollView>
【问题讨论】:
-
我做到了,但仍然没有出现水平滚动...使用 android:layout_width="wrap_content" 设置图像视图列表是否正确?
-
线性布局旁边
标签: android android-layout scrollview android-linearlayout horizontalscrollview