Android的滚动型scrollbarSizeAndroid、scrollbarSize

2023-09-06 03:19:17 作者:艳若桃李冷如霜

我使用的是滚动型,我想设置滚动条大小,但一切我尝试失败。 我试着用属性的android:scrollbarSize,有型有款,有主题,但一无所获。滚动条的大小它总是同样的。 有什么建议么?谢谢

I'm using a ScrollView and i want to set the ScrollBar size, but everything i tried failed. I tried with attribute android:scrollbarSize, with style, with theme but nothing. The size of the scrollbar it's always the same. Any suggestions? Thanks

我试着用这样的:

<ScrollView 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:layout_marginTop="10px"
android:layout_marginBottom="15px"
android:scrollbarSize="20px"
android:scrollbarTrackVertical="@drawable/scrollbar_reflection"
android:scrollbarThumbVertical="@drawable/scrollbar_state2">

但滚动条的宽度不发生变化。

but the width of the Scrollbar doesn't change.

所以我创建了这样一个麦粒肿文件:

So i created a stye file like this:

<resources>
   <style name="ShowAllScrollBar1">
     <item name="android:scrollbarSize">20px</item>           
 </style>
</resources>

,然后设置样式AndroidManifest。

and then set style in AndroidManifest.

推荐答案

我其实一直努力奋斗着这一点。不幸的是,看来这个问题实际上是在Android源$ C ​​$ C,而不会被固定,直到下一次的Andr​​oid版本。经过一番搜索,我发现这个信息在这里: HTTP: //$c$c.google.com/p/android/issues/detail?id=14317 。

I've actually been struggling with this as well. Unfortunately, it appears that the problem is actually in the Android sourcecode, and will not be fixed until the next Android release. After a bit of searching, I found this info here: http://code.google.com/p/android/issues/detail?id=14317.