ScrollView有很多属性管理它的样式,如果在xml中设置,可以在<ScrollView >标签内设置滚动条样式的属性:
• android:scrollbars="none",不显示滚动条,但能够滚动的;
• android:scrollbarSize,滚动条大小。
修改上面的例子添加这些属性xml布局文件代码如下:

Java代码
  1. <?xmlversion="1.0"encoding="utf-8"?>
  2. <ScrollViewxmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="wrap_content"
  5. android:scrollbarSize="12dip"
  6. android:scrollbars="none"
  7. >
  8. <LinearLayoutandroid:orientation="vertical"
  9. android:layout_width="fill_parent"android:layout_height="fill_parent">
  10. <TextViewandroid:layout_width="fill_parent"
  11. android:layout_height="wrap_content"android:text="@string/hello"
  12. android:textSize="20dip"/>
  13. <TextViewandroid:layout_width="fill_parent"
  14. android:layout_height="wrap_content"android:text="@string/content"/>
  15. </LinearLayout>
  16. </ScrollView>

更多相关文章

  1. android动态控制组件的位置、大小和新的动画
  2. Android中persistent属性用法详解
  3. Android(安卓)设计模式 笔记 - 深入了解属性动画
  4. Android(安卓)开发之通用的 PopupWindow
  5. 设置程序[置顶] android(10)_android权限大全
  6. Android中Adapter使用ViewHolder优化
  7. Android(安卓)Studio初次使用genymotion注意几点
  8. Android之多语言设置
  9. android 焦点控制

随机推荐

  1. 一步一步学Silverlight 2系列(3):界面布局
  2. vim / vi / linux:正确缩进html文件
  3. Javascript将ID添加到HTML href
  4. 如何使用JavaScript验证此HTML表单?
  5. 怎么用.net把带html标签的字符导出到Exce
  6. 使用window.open将变量传递给新的HTML
  7. 你能告诉为什么javascript函数没有在prof
  8. 使用 jQuery Mobile 与 HTML5 开发 Web A
  9. 我怎么能用javascript编写这个简短的函数
  10. NodeList接口,HTMLCollection接口