设置滚动条拇指的样式

时间:2013-08-21 15:48:40

标签: android android-layout android-scrollbar

我正在尝试更改ListView的滚动条缩略图的外观。

我将以下属性添加到listview:

android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb"


scrollbar_vertical_thumb.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 
    <gradient android:angle="0" android:endColor="#FF9900" android:startColor="#FF9900"/> 
    <corners android:radius="1dp" /> 
    <size android:width="3dp" /> 
</shape>


在应用我的渐变之后,我注意到我有滚动条或滚动条拇指,如下图所示(在页面的开头是左边的,然后它变为第二个):

enter image description here

好像我没有覆盖滚动条拇指的主题样式。

有人知道吗,可能出现什么问题?

2 个答案:

答案 0 :(得分:2)

您已覆盖错误的财产。

你应该这样做:

<item name="android:fastScrollThumbDrawable">@drawable/scrollbar_vertical_thumb</item>

答案 1 :(得分:1)

通过添加&#39; scrollbarThumbVertical&#39;更新您的ListView属性,

[cmd] => _notify-validate
[txn_type] => subscr_signup
[subscr_id] => I-AN3DCCNUT8B4
[last_name] => buyer
[residence_country] => GB
[mc_currency] => USD
[item_name] => 12 Months - 6 Issue (Digital)
[business] => facilitator@tr2w.com
[amount3] => 19.00
[recurring] => 1
[address_street] => 1 Main Terrace
[payer_status] => verified
[payer_email] => buyer@tr2w.com
[address_status] => confirmed
[first_name] => buyer
[receiver_email] => facilitator@tr2w.com
[address_country_code] => GB
[payer_id] => K6YW3FZC8PHSE
[address_city] => Wolverhampton
[reattempt] => 1
[item_number] => digital_6
[address_state] => West Midlands
[subscr_date] => 03:48:50 Jun 10, 2016 PDT
[address_zip] => W12 4LQ
[charset] => windows-1252
[period3] => 1 Y
[address_country] => United Kingdom
[mc_amount3] => 19.00
[address_name] => buyer buyer
[auth] => *****
[form_charset] => UTF-8

然后将以下内容添加到&#39; scrollbar_vertical_thumb.xml&#39;在drawable文件夹中,

android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb"