2011.09.14——— android listview的横向滚动
参考:[url]http://topic.youkuaiyun.com/u/20100817/22/0337960e-fe08-4aff-8d48-2aeb3c9cc3f7.html[/url]
[url]http://www.eoeandroid.com/thread-75501-1-1.html[/url]
问题:item过长 需要listview横向滚动显示
解决:listView外层加一个线性容器 然后在线性容器外边加一个HorizontalScrollview 即可
效果如下图:
[img]http://dl.iteye.com/upload/attachment/553728/81d2989b-b6d5-3bb6-916c-850575fe08fe.jpg[/img]
参考:[url]http://topic.youkuaiyun.com/u/20100817/22/0337960e-fe08-4aff-8d48-2aeb3c9cc3f7.html[/url]
[url]http://www.eoeandroid.com/thread-75501-1-1.html[/url]
问题:item过长 需要listview横向滚动显示
解决:listView外层加一个线性容器 然后在线性容器外边加一个HorizontalScrollview 即可
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:id="@+id/linearLayout1"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:orientation="horizontal">
<ListView
android:id="@+id/list1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"></ListView>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
效果如下图:
[img]http://dl.iteye.com/upload/attachment/553728/81d2989b-b6d5-3bb6-916c-850575fe08fe.jpg[/img]