Android SeekBar thumb自定义 [英] Android SeekBar thumb Customization

查看:359
本文介绍了Android SeekBar thumb自定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想隐藏栏,只想显示拇指.我用max-height = 0dip做到了,但是没有完全起作用.我还想在拇指上设置文本并创建带有多个图像的拇指.例如,我的i按钮像图像一样的拇指,并带有文本,而该按钮具有尾部下排字,其随着行的增加而增加.

I want to hide bar and only want to show thumb. I did it with max-height=0dip but it did not completely work. I also want to set text on thumb and create thumb with multiple images. For example thumb which i button like image and has text and this button has tail downword, which increases with row increment.

推荐答案

关于删除背景,我设法通过以下方式进行.在这里,空白的可绘制对象是1x1像素的透明png

Regarding removing the background, I managed to do this in the following way. Here, the blank drawable is a transparent png of 1x1 pixel

    <SeekBar
        android:id="@+id/bar"
        android:layout_width="fill_parent"
        android:layout_height="30dip"
        android:progressDrawable="@drawable/blank"
     />

您还可以使用以下方法更改可绘制对象:

You can also change the drawable by using:

android:thumb="@drawable/icon"

要添加文本,我想您必须创建一个自定义组件

To add text, I guess you'll have to create a custom component

这篇关于Android SeekBar thumb自定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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