如何在ScrollView android中更改实际滚动的颜色? [英] how to change color of the actual scroll in ScrollView android?
问题描述
我想知道是否可以更改ScrollView的颜色.
I'm wondering if it's possible to change the color of the ScrollView.
我指的不是背景色或边缘.
我附上了我所指的酒吧的印刷屏幕.对我来说,这是透明的.
I'm not referring to the background color or the edges.
I attached a print screen of the bar I'm referring. For me, it's kind of transparnt.
这是我在xml中定义它的方式:
Here's how I defined it in the xml:
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadeScrollbars="false"
android:layout_toLeftOf="@+id/personalscores_BackButton"
android:layout_marginRight="0dp" >
推荐答案
使用此方法在drawable(scrollbar.xml)中创建滚动条
Create a scroll bar in drawable(scrollbar.xml) using this
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="45"
android:centerColor="#65FF8215"
android:endColor="#87FD2125"
android:startColor="#65FF8215" />
<corners android:radius="20dp" />
</shape>
并将此滚动条(如android:scrollbarThumbVertical="@drawable/scrollbar"
)添加到您的ListView
and add this scroll bar like android:scrollbarThumbVertical="@drawable/scrollbar"
to your ListView
OR
将以下属性放入您的布局
put the following attribute to your layout
android:scrollbarThumbVertical="@android:color/white"
OR
创建图像并将其放置在可绘制区域中.然后将以下属性添加到您的布局中
create a image and put it in drawable. then add the following property to your layout
android:scrollbarThumbVertical="@drawable/scroll_bar_vertical"
这篇关于如何在ScrollView android中更改实际滚动的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!