Насколько я разобрался, ListView вертикальную прокрутку организует сам, а для горизонтальной надо его засунуть в HorizontalScrollView. И все замечательно работает, пока ширина ListView больше ширины экрана. Но вот в обратном случае, HorizontalScrollView плюет на указанное ему "match_parent" в ширину и в итоге вертикальная прокрутка ListView вылезает посреди экрана, его разделители обрываются там же.
Как сие забороть ? Как заставить HorizontalScrollView растянуться по всему экрану в ширину ?
Вот собссно, образец
Код: Выделить всё
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ReportActivity" >
<RelativeLayout
android:id="@+id/msg_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<TextView
android:id="@+id/msg_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/msg_btn"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:onClick="onClickHideMsg"
android:text="@string/msg_x" />
</RelativeLayout>
<HorizontalScrollView
android:id="@+id/horzScroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="@+id/msg_layout" >
<ListView
android:id="@+id/listView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ListView>
</HorizontalScrollView>
</RelativeLayout>
Код: Выделить всё
android:layout_width="match_parent"