首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android SeekBar [ProgressBar] style -如何设置自定义背景可绘制

Android SeekBar [ProgressBar] style -如何设置自定义背景可绘制
EN

Stack Overflow用户
提问于 2011-02-17 10:16:56
回答 3查看 8.2K关注 0票数 0

我想这样做:,I,ve already found customizing seekbars over herehttp://groups.google.com/group/android-developers/browse_thread/thread/be3fed0b4f766cc?pli=1 but the problem is, that I need **those gaps** between in my drawable and I don,I,ve already found customizing seekbars over here,I,http://groups.google.com/group/android-developers/browse,I,_thread/thread/be3fed0b4f766cc?pli=1 but the problem is, that I need **those gaps** between in my drawable and I don,I,I,ve already found customizing seekbars over here,I,http://groups.google.com/group/android-developers/browse,I,_thread/thread/be3fed0b4f766cc?pli=1 but the problem is, that I need **those gaps** between in my drawable and I don,I,ve already found customizing seekbars over here,I,I,http://groups.google.com/group/android-developers/browse,I,_thread/thread/be3fed0b4f766cc?pli=1 but the problem is, that I need **those gaps** between in my drawable and I don,I,I,ve already found customizing seekbars over here,I,http://groups.google.com/group/android-developers/browse,I,I,_thread/thread/be3fed0b4f766cc?pli=1 but the problem is, that I need **those gaps** between in my drawable and I don,I,ve already found customizing seekbars over here,I,I,http://groups.google.com/group/android-developers/browse,I,_thread/thread/be3fed0b4f766cc?pli=1 but the problem is, that I need **those gaps** between in my drawable and I don,I,I,如果你们中的一些人这么好,我将非常感激。提前感谢,祝一切顺利!

这是应用于搜索栏的我的资源style.xml文件:

代码语言:javascript
复制
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/seekbarcolors</item>
<item name="android:indeterminateDrawable">@drawable/seekbarcolors</item>
<item name="android:minHeight">20dip</item>
<item name="android:maxHeight">20dip</item>
<item name="android:thumbOffset">8px</item>
<item name="android:focusable">true</item>

下面是我的@drawable/seekbarcolors:

代码语言:javascript
复制
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
    <shape>
        <solid android:color="#ff0000" />
    </shape>
</item>
<item android:id="@android:id/secondaryProgress">
    <clip>
        <shape>
            <solid android:color="#00ff00" />
        </shape>
    </clip>
</item>
<item android:id="@android:id/progress">
    <clip>
        <shape>
            <solid android:color="#0000ff" />
        </shape>
    </clip>
</item>

EN

回答 3

Stack Overflow用户

发布于 2011-02-17 11:07:33

Seekbar是一个非常强大的小工具。您希望用户能够在此处“查找”卷吗?它不是用来显示差距的进展的。

这里你需要的(如果你不需要抓取和寻找卷)要简单得多。在你的示例图片中“音量”的右边创建一个ImageView。在您的进度监视AsyncTask中,将代码放在onProgressUpdate()中,以更改10个图像中显示的图像-每个图像与上一个相同,但多了一个条形图-因为进度超出了10%。您可以编写代码来将单个图像时间正确地放置在空间中,但这会更难,而且购买成本很低。

票数 1
EN

Stack Overflow用户

发布于 2011-02-17 18:48:42

事情是,我需要寻求volume..as你可以看到,我已经与我的自定义形状设置颜色设置搜索栏最后一件事是我需要做的是创建可重复的形状与不透明度块1和块不透明度0。如何做到这一点?我是android开发的新手,因此在形状方面不是很聪明:)谢谢

票数 0
EN

Stack Overflow用户

发布于 2013-08-07 13:58:57

在android的framework/core/res/res/layout中更改音量栏颜色在volume_adjust.xml中更改颜色

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5024399

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档