制作一个自定义紧身进度/搜索栏 [英] Making A Custom Skinny ProgressBar / Seekbar

查看:204
本文介绍了制作一个自定义紧身进度/搜索栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个较高的水平,我已经做了几种类型的进度条样式,但他们是当我试图让他们瘦小的所有丑陋的。

At a high level, I have done several types of progress bar styles, but they are all ugly when I have attempted to make them skinny.

我要寻找一个快速开始指南或布局,将给予一间酒吧,类似于下图

I am looking for a jump start tutorial or layout that will give a bar that looks similar to below image

任何想法?我会很高兴地公布结果,当/如果我让他们的工作。

Any ideas? I will be glad to publish the results when/if I get them working.

推荐答案

有一个属性机器人:它了maxHeight不正是你需要的。你应该设置的android:拇指可绘制大于给了maxHeight达到光滑的搜索栏效果

There is a property android:maxHeight which does exactly what you need. You should set the android:thumb drawable bigger than the maxHeight to achieve the slick seekbar effect.

例如:

  <SeekBar
      android:id="@+id/whiteBalanceSeek"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="3dp"
      android:max="200"
      android:maxHeight="3dp"
      android:paddingLeft="10dp"
      android:paddingRight="10dp"
      android:progress="100"
      android:progressDrawable="@drawable/slider_progress"
      android:thumb="@drawable/thumb_img" />

该slider_progress绘制从<一个取href="http://stackoverflow.com/questions/2020882/how-to-change-progress-bars-progress-color-in-android">here而thumb_img是光秃秃的PNG有一个红色的圆圈。

The slider_progress drawable was taken from here and the thumb_img is a bare PNG with a red circle.

下面是我得到了什么:

这篇关于制作一个自定义紧身进度/搜索栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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