是否有可能改变Android的搜索栏的形状? [英] Is it possible to change the shape of android seek bar?

查看:172
本文介绍了是否有可能改变Android的搜索栏的形状?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要实现类似到Android寻求bar.But不是以线性方式的东西,在一个弧形。是有可能定制寻求在圆弧状条?

I want to implement something similar to android seek bar.But not in a linear fashion,in an arc shape. is it possible to customize the seek bar in an arc shape?

推荐答案

您不能让搜索栏绘制其拇指比水平偏移任何其他方式。

You can't make SeekBar to draw its thumb any other way than offset horizontally.

在code,实际上吸引拇指在AbsSeekBar.onDraw,有它看到,它只是水平偏移。
然而,你可能让自己的小部件延长进度,这将得出所需的任何方式拇指(弧)。但你也需要做出响应触摸它,进度预计转换为线性范围。

The code that actually draws thumb is in AbsSeekBar.onDraw, and there it's seen it's just horizontal offset. You may however make your own widget extending ProgressBar, which would draw thumb whatever way is needed (in arc). But you'll also need to make response to touches to translate it to linear range that ProgressBar expects.

这篇关于是否有可能改变Android的搜索栏的形状?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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