Android 原生进度条ProgressBar【自带】【水平风格】自定义

由于不想从零开始自定义,Android原生的进度条就已经很够用了呀!

xml 复制代码
<ProgressBar​
    android:id="@+id/pb_storage"​
    style="@style/Widget.AppCompat.ProgressBar.Horizontal"​
    android:layout_width="match_parent"​
    android:layout_height="8.33dp"​
    android:layout_marginTop="5.67dp"​
    android:background="@null"​
    android:progressDrawable="@drawable/progress_00b502_22" />
   
xml 复制代码
<?xml version="1.0" encoding="utf-8"?>​
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">​
    <!-- 设置背景色 -->​
    <item android:id="@android:id/background">​
        <shape>​
            <corners android:radius="22dp" />​
            <solid android:color="#E3E3E3" />​
​
        </shape>​
​
    </item>​
    <!-- 设置进度条颜色 -->​
    <item android:id="@android:id/progress">​
        <clip>​
            <shape>​
                <solid android:color="#00B502" />​
                <!-- 设置圆角 -->​
                <corners android:radius="22dp" />​
​
            </shape>​
​
        </clip>​
    </item>​
</layer-list>
相关推荐
Kapaseker8 小时前
详解 Compose background 的重组陷阱
android·kotlin
黄林晴8 小时前
Kotlin 2.3.20-RC2 来了!JPA 开发者狂喜,6 大更新一文速览
android·kotlin
kymjs张涛1 天前
OpenClaw 学习小组:初识
android·linux·人工智能
范特西林1 天前
实战演练——从零实现一个高性能 Binder 服务
android
范特西林1 天前
代码的生成:AIDL 编译器与 Parcel 的序列化艺术
android
范特西林1 天前
深入内核:Binder 驱动的内存管理与事务调度
android
范特西林1 天前
解剖麻雀:Binder 通信的整体架构全景图
android
范特西林1 天前
破冰之旅:为什么 Android 选择了 Binder?
android
奔跑中的蜗牛6661 天前
一次播放器架构升级:Android 直播间 ANR 下降 60%
android
测试工坊1 天前
Android 视频播放卡顿检测——帧率之外的第二战场
android