移动我的进度与图像机器人 [英] move my progressbar with an image android

查看:158
本文介绍了移动我的进度与图像机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个code

是一个进度条,填充红色

is a progress bar that fill with a red color

<?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>
            <gradient
            android:startColor="#c3c3c3"
                android:centerColor="#c3c3c3"
                android:centerY="0.75"
                android:endColor="#7f7f7f"
                android:angle="270"/>
            <padding android:left="1dp"
            android:top="1dp"
            android:right="1dp"
            android:bottom="1dp"/> 
        <corners android:radius="10dp"/> 
    </shape>
</item>

<item android:id="@android:id/secondaryProgress">
    <clip>
        <shape>
            <gradient
                android:startColor="#234"
                android:centerColor="#234"
                android:centerY="0.75"
                android:endColor="#a24"
                android:angle="270"/>
            <padding android:left="1dp"
                android:top="1dp"
                android:right="1dp"
                android:bottom="1dp"/> 
            <corners android:radius="10dp"/> 
            </shape>
    </clip>
</item>

<item android:id="@android:id/progress">
    <clip>
       <shape>
            <gradient
                android:startColor="#a42c48"
                android:centerColor="#a42c48"
                android:centerY="0.75"
                android:endColor="#eb3e67"
                android:angle="270"/>
            <padding android:left="1dp"
                android:top="1dp"
                android:right="1dp"
                android:bottom="1dp"/> 
            <corners android:radius="10dp"/> 
        </shape>
    </clip>
    </item>
</layer-list>

和看起来像这样

现在我想添加图像移动的同时,进度条满了像下面

now i want to add an image to move at the same time the progress bar fills up like the image below

请帮我

在此先感谢

推荐答案

也许你可以用你的layerlist风格搜索栏(而不是进度),并添加您的图像拇指洗涤?

Maybe you could style a seekbar (instead of a progressbar) using your layerlist and add your image as the thumb scrubber?

<SeekBar
                android:id="@+id/seekBar1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:thumb="@drawable/your_android_image"
                android:progressDrawable="@drawable/your_layerlist_drawable"
                />

这篇关于移动我的进度与图像机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆