如何在Android布局中使用圆形起点设置进度条?

发布于 2025-01-22 04:45:15 字数 1057 浏览 2 评论 0原文

我正在尝试使用Android中给出的默认进度栏创建一个进度栏,我实现了80%的需要设计,但找不到完成所需设计的代码。

这是必需的设计

给定设计 我需要在我的进度栏中带上圆形的零件[以蓝色突出

显示

]

                        <ProgressBar
                            android:id="@+id/ww_progress_bar"
                            android:visibility="visible"
                            style="?android:attr/progressBarStyleHorizontal"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:background="@drawable/circular_shape"
                            android:progressDrawable="@drawable/circular_progress_bar"
                            android:textAlignment="center" />

KT课程

        binding.wwProgressBar.visibility = VISIBLE
        binding.wwProgressBar.setProgress(40)
        binding.wwProgressBar.max = progressMax

是否可以带来所需的设计?谁能帮助完成这一设计?

I am trying to create a progress bar using default progress bar given in android , I achieved 80% of that required design but i cannot find a code to finish the required design.

this is a required design

given design
i need to bring the rounded part [highlighted in blue ] in my progress bar

finished design

xml code

                        <ProgressBar
                            android:id="@+id/ww_progress_bar"
                            android:visibility="visible"
                            style="?android:attr/progressBarStyleHorizontal"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:background="@drawable/circular_shape"
                            android:progressDrawable="@drawable/circular_progress_bar"
                            android:textAlignment="center" />

KT class

        binding.wwProgressBar.visibility = VISIBLE
        binding.wwProgressBar.setProgress(40)
        binding.wwProgressBar.max = progressMax

is it possible to bring the required design? can anyone help to finish this design?

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

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

发布评论

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

评论(2

酸甜透明夹心 2025-01-29 04:45:15

您需要使用seek bar来

使用自定义拇指

轻松实施,

可以使用gihub库

https:// https:// https:// github.com/tankery/circularseekbar

you need to use seek bar for it

use custom thumb for it

or

for easy implementation

you can use gihub library

https://github.com/tankery/CircularSeekBar

空袭的梦i 2025-01-29 04:45:15

您应该在pregressbar中设置thumb

android:thumb="@drawable/thumb_seekbar"

您可以使用此链接有关更多信息

you should set thumb in your ProgressBar

android:thumb="@drawable/thumb_seekbar"

you can use this link for more information

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