2011.09.14——— android listview的横向滚动
16lz
2021-01-24
2011.09.14——— android listview的横向滚动
参考: http://topic.csdn.net/u/20100817/22/0337960e-fe08-4aff-8d48-2aeb3c9cc3f7.html
http://www.eoeandroid.com/thread-75501-1-1.html
问题:item过长 需要listview横向滚动显示
解决:listView外层加一个线性容器 然后在线性容器外边加一个HorizontalScrollview 即可
效果如下图:
参考: http://topic.csdn.net/u/20100817/22/0337960e-fe08-4aff-8d48-2aeb3c9cc3f7.html
http://www.eoeandroid.com/thread-75501-1-1.html
问题:item过长 需要listview横向滚动显示
解决:listView外层加一个线性容器 然后在线性容器外边加一个HorizontalScrollview 即可
<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><HorizontalScrollViewandroid:id="@+id/horizontalScrollView1"android:layout_width="wrap_content"android:layout_height="wrap_content"><LinearLayoutandroid:layout_width="fill_parent"android:id="@+id/linearLayout1"android:layout_height="fill_parent"android:layout_width="wrap_content"android:orientation="horizontal"><ListViewandroid:id="@+id/list1"android:layout_height="wrap_content"android:layout_width="fill_parent"></ListView></LinearLayout></HorizontalScrollView></LinearLayout>
效果如下图:
更多相关文章
- Android(安卓)下拉刷新 左右滑动 事件冲突
- android_14 线性布局2
- android如何在代码中设置margin
- Android 线性布局 计算器
- 线性布局练习
- 内存优化之其他优化(容器数据遍历方案,arraymap使用及java自动装箱
- Android中你也许不知道的线性布局Layout_weight属性权重比例分配
- Android开发——纯JAVA代码方式界面设计