2
我有這個佈局,因爲沒有顯示horizontalscrollview: 基本上在第一個容器有兩個兒童佈局,第一個是固定的,第二個應該水平滾動但是第二個沒有出現。android-linearlayout在horizontalscrollview內不起作用
的@繪製/ 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」? – Nadir
旁邊的線性佈局 – Nadir