如何减少FastScroll Thumb Size

时间:2015-06-11 03:51:15

标签: android android-layout android-styles

左图 - 这是我的快速滚动拇指所需的尺寸(小)。
正确的图像 - 这是我得到的尺寸(非常大)。
This is the size i want to my scroll thumb enter image description here

MyFragment.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">


<ListView
    android:id="@+id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"></ListView>
</RelativeLayout>

style.xml

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/ColorPrimary</item>
    <item name="colorPrimaryDark">@color/ColorPrimaryDark</item>
</style>

<style name="AppTheme.Main" parent="Theme.AppCompat">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/ColorPrimary</item>
    <item name="colorPrimaryDark">@color/ColorPrimaryDark</item>
    <item name="android:fastScrollThumbDrawable">@drawable/ic_datejumper</item>
    <item name="android:fastScrollTrackDrawable">@android:color/transparent</item>
</style>

<style name="AppTheme.Pref" parent="Theme.AppCompat">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/ColorPrimary</item>
    <item name="colorPrimaryDark">@color/ColorPrimaryDark</item>
</style>

</resources>

我尝试了通过互联网和stackoverflow发现的所有方法 如果您想查看,左侧图片来自Google相册

1 个答案:

答案 0 :(得分:1)

刚刚找到一个不寻常的答案
我把png放在drawables-xhdpi文件夹中,这就是诀窍