android - 如何减小 FastScroll 拇指大小

标签 android android-layout android-styles

左侧图像 - 这是我需要的 Fast Scroll Thumb(小)尺寸。
右图 - 这是我得到的尺寸(非常大)。
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 相册应用

最佳答案

刚找到一个不寻常的答案
我将 png 放在 drawables-xhdpi 文件夹中,这样就成功了

关于android - 如何减小 FastScroll 拇指大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30771246/

相关文章:

android - 添加到 ListView 时按钮不可点击

Android:工具栏文本显示为黑色而不是白色

android - 自定义溢出图标太大(使用 android.support.v7 和 AppCompat)

Android Theme 样式文件合并

java - AlarmManager 启动的 Intents 会在运行之间保留其对象吗?

android - 带代理的 Flutter WebView

java - 如何使用java获取zip中的特殊文件偏移量

android - 如何将单选按钮对齐到关联文本的右侧?

Android PreferenceScreen - 我可以在不将首选项保存到 SharedPreferences 的情况下使用它吗?

android - 在 CollapsingToolbarLayout 中设置 minHeight 没有任何效果