Android:覆盖应用程序中的可绘制滚动条

发布于 2024-09-15 04:16:28 字数 214 浏览 4 评论 0原文

有没有办法替换应用程序中的可绘制滚动条(即我有一个自定义的滚动条视图,我想使用它来代替 Android 框架附带的默认灰色滚动条)。我查看了我相信所有的 android 属性,但似乎没有一个支持它(至少我知道的最简单的方法是我假设将一个可绘制对象设置为某个 android 属性)。

如果不是,并说它需要对框架进行更改,我将在哪里开始寻找它(在框架中)?

谢谢

MB

Is there a way to replace the scrollbar drawable in an application (i.e. I have a customized scrollbar view that I would like to use instead of the default gray scrollbar that comes with the Android framework). I looked through I believe all of the android attributes and none seem to support it (at least the simplest way I know how which I would assume would be setting a drawable to some android attribute).

If not and say it requires a change in the framework, where would I start looking for it (in the framework)?

Thanks

MB

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘亓 2024-09-22 04:16:28

自定义滚动条拇指:

android:scrollbarThumbHorizontal="..."
android:scrollbarThumbVertical="..."

自定义滚动条轨道(滚动条背景):

android:scrollbarTrackHorizontal="..."
android:scrollbarTrackVertical="..."

Custom scrollbar thumb:

android:scrollbarThumbHorizontal="..."
android:scrollbarThumbVertical="..."

Custom scrollbar track (scrollbar background):

android:scrollbarTrackHorizontal="..."
android:scrollbarTrackVertical="..."
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文