Android(安卓)ApiDemos示例解析(189):Views->ScrollBars->2.Fancy
ScrollView 的滚动条背景和滑块可以定制,本例使用drawable 为ScrollView定制了滚动条和滑块,滚动条宽度设为12dip ,滑块为蓝色等
<ScrollView xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:scrollbarTrackVertical=”@drawable/scrollbar_vertical_track”
android:scrollbarThumbVertical=”@drawable/scrollbar_vertical_thumb”
android:scrollbarSize=”12dip”>
<LinearLayout
android:orientation=”vertical”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”>
<TextView
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”@string/scrollbar_2_text”/>
…
<TextView
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”@string/scrollbar_2_text”/>
</LinearLayout>
</ScrollView>
ScrollBars->2.Fancy_第1张图片" width="332" height="493" style="padding:0px; border:none; margin:5px auto; font:inherit; vertical-align:baseline; max-width:100%; height:auto; display:block;border:1px solid black;">
更多相关文章
- Android(安卓)ListView拖动时背景颜色会变成黑色的解决办法
- [置顶] android应用框架系列三,兼容性
- Android(安卓)布局添加阴影背景ShadowDrawable
- android 中TextView设置部分文字背景色和文字颜色
- Lgame引擎搭建和第一个例子
- 6.1.5 GridView详解编辑
- android 代码控制LinearLayout 宽度高度 报错widget.LinearLayou
- Android(安卓)侧滑,左滑,右滑
- Android——FragmentTabHost-快速实现底部导航模式的解决方案