当前位置:操作系统 > 安卓/Android >>

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>

 \

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,