我怎样才能改变一个滚动条的宽度/厚度? [英] How can I change the width/thickness of a scrollbar?

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

问题描述

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

<?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>

这是我的滚动型:

And this is my ScrollView:

<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.

我是否能够设置一个滚动型属性来调整滚动条的宽度/厚度?或者,我可以把一个属性在我的梯度?

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天全站免登陆