ScrollView隐藏、调整大小
16lz
2021-01-26
ScrollView有很多属性管理它的样式,如果在xml中设置,可以在<ScrollView >标签内设置滚动条样式的属性:
• android:scrollbars="none",不显示滚动条,但能够滚动的;
• android:scrollbarSize,滚动条大小。
修改上面的例子添加这些属性xml布局文件代码如下:
- <?xmlversion="1.0"encoding="utf-8"?>
- <ScrollViewxmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:scrollbarSize="12dip"
- android:scrollbars="none"
- >
- <LinearLayoutandroid:orientation="vertical"
- android:layout_width="fill_parent"android:layout_height="fill_parent">
- <TextViewandroid:layout_width="fill_parent"
- android:layout_height="wrap_content"android:text="@string/hello"
- android:textSize="20dip"/>
- <TextViewandroid:layout_width="fill_parent"
- android:layout_height="wrap_content"android:text="@string/content"/>
- </LinearLayout>
- </ScrollView>
更多相关文章
- android动态控制组件的位置、大小和新的动画
- Android中persistent属性用法详解
- Android(安卓)设计模式 笔记 - 深入了解属性动画
- Android(安卓)开发之通用的 PopupWindow
- 设置程序[置顶] android(10)_android权限大全
- Android中Adapter使用ViewHolder优化
- Android(安卓)Studio初次使用genymotion注意几点
- Android之多语言设置
- android 焦点控制