如何更改滚动条的宽度/厚度? [英] How can I change the width/thickness of a scrollbar?

查看:37
本文介绍了如何更改滚动条的宽度/厚度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前这是我的 scrollbar.xml 文件:

Currently this is my scrollbar.xml file:

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

    <gradient
        android:angle="45"
        android:centerColor="@color/blue"
        android:endColor="@color/blue"
        android:startColor="@color/blue" />

    <corners android:radius="8dp" />

</shape>

这是我的滚动视图:

<ScrollView
    android:id="@+id/scrollView1"
    android:scrollbarThumbVertical="@drawable/scrollbar"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/btnBack" >

这是它给我的滚动条.很好,只是它太厚太明显了.在此屏幕截图中它可能看起来并不厚实,但确实如此.

This is the scrollbar it gives me. It's good, except it's too thick and obvious. It may not look thick in this screenshot, but it really is.

我可以设置 ScrollView 属性来调整滚动条的宽度/厚度吗?或者我可以在我的渐变中放置一个属性吗?

Am I able to set a ScrollView property to adjust the width/thickness of the scrollbar? Or can I put a property in my gradient?

推荐答案

将以下属性添加到您的布局

add the following property to your layout

android:scrollbarSize="50dip"

这篇关于如何更改滚动条的宽度/厚度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆