ScrollView的用法,隐藏滚动条
来源:互联网 发布:淘宝最火的男装店 编辑:程序博客网 时间:2024/05/08 09:05
我之前写了一个ScrollView老是报java.lang.IllegalStateException: ScrollView can host only one direct child,意思是说:ScrollView只能有一个子布局,所以用一个布局把你写的布局抱起来就OK,隐藏滚动条。
<pre name="code" class="java"><pre name="code" class="java"><ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="none" >//设置隐藏滚动条 <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="80dp" android:gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是左边的" android:textSize="25sp" /> <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是右边的" android:textSize="25sp" /> </LinearLayout> <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="80dp" android:gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是左边的" android:textSize="25sp" /> <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是右边的" android:textSize="25sp" /> </LinearLayout> <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="80dp" android:gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是左边的" android:textSize="25sp" /> <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是右边的" android:textSize="25sp" /> </LinearLayout> <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="80dp" android:gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是左边的" android:textSize="25sp" /> <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是右边的" android:textSize="25sp" /> </LinearLayout> <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="80dp" android:gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是左边的" android:textSize="25sp" /> <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是右边的" android:textSize="25sp" /> </LinearLayout> <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="80dp" android:gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是左边的" android:textSize="25sp" /> <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是右边的" android:textSize="25sp" /> </LinearLayout> <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="80dp" android:gravity="center" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是左边的" android:textSize="25sp" /> <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="我是右边的" android:textSize="25sp" /> </LinearLayout> <View android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/black" /> </LinearLayout> </ScrollView>
效果如下:
0 0
- ScrollView的用法,隐藏滚动条
- ScrollView隐藏滚动条
- ScrollView隐藏滚动条
- ScrollView隐藏滚动条
- Android 隐藏ScrollView的滚动条
- Scrollview滚动条用法
- andorid scrollView隐藏滚动条
- 关于ScrollView滚动条隐藏。
- 设置ScrollView的滚动条为隐藏的方法,scrollview滚动条
- 设置ScrollView的滚动条为隐藏的方法,scrollview滚动条
- 隐藏scrollview滚动条的几种方法
- 如何隐藏滚动条在ScrollView中
- 如何隐藏滚动条在ScrollView中
- ScrollView隐藏滚动条、顶部顶部阴影
- Android TextView多行文本滚动实现与ScrollView的滚动条为隐藏的方法
- 没有滚动条的ScrollView
- 去掉ScrollView的滚动条
- Android 关于设置ScrollView的滚动条为隐藏的方法
- 游戏任务成就体系的实现(附二):常用功能/扩展包的使用 Async Cluster
- ajax跨域请求的解决办法
- 使用Apache POI开源包进行Excel读取
- Java Map遍历方式方式及性能比较
- Android系统联系人全特效实现(上),分组导航和挤压动画
- ScrollView的用法,隐藏滚动条
- 大师是怎样炼成的
- Android入门之在WmS中注册InputChannel
- Hibernate4实战 之 第一部分 Hibernate入门
- HDU2097 Sky数【水题】
- simple-spring-memcached 注解配置
- ThinkPHP框架中的U方法分析
- 判定鼠标点击某一控件
- SQL 事务 (存储过程与事务)