自定义漂亮的Android SeekBar样式

本文介绍了如何自定义美观的Android SeekBar样式,通过提供XML布局和图片资源的示例,展示了创建不同效果Seekbar的步骤。内容包括使用PhotoShop制作.9图片,以及替换系统默认样式的方法。
摘要由CSDN通过智能技术生成

系统自带的SeekBar真是太难看了,不能容忍! 只能自己做了,先来张效果图

 

第1个Seekbar 背景是颜色,thumb是图片,上代码:

 

<SeekBar
        android:id="@+id/timeline"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:maxHeight="4.0dip"
        android:minHeight="4.0dip"
        android:paddingLeft="16.0dip"
        android:paddingRight="16.0dip"
        android:progressDrawable="@drawable/po_seekbar"
        android:thumb="@drawable/seekbar_thumb" />

drawable/po_seekbar.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>
            <solid android:color="#ff51495e" />
        </shape>
    </item>
    <item android:id="@*android:id/secondaryProgress">
        <clip>
            <shape>
                <solid android:color="#ff51495e" />
            </shape>
        </clip>
    </item>
    <item android:id="@*android:id/progress">
        <clip>
            <shape>
                <solid android:color="#ff996dfe" /&
  • 30
    点赞
  • 108
    收藏
    觉得还不错? 一键收藏
  • 29
    评论
评论 29
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值