禁用seekBar而不调光 [英] Disabled seekBar without dimming

查看:43
本文介绍了禁用seekBar而不调光的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在特殊情况下,我需要防止用户输入搜索栏.如果我使用 setEnabled(false) 它会变成灰色而不是白色.

I need to prevent seekbar from user inputs in special cases. If I use setEnabled(false) it becomes gray instead of white.

有没有什么方法可以在不变暗的情况下禁用搜索栏或为禁用搜索栏的进度设置另一个drawable?

Is there any method to disable seekbar without dimming or set another drawable for progress in disabled seekbar ?

推荐答案

我不知道你为什么要改变这个,而且我不认为为用户覆盖视觉队列是什么好的做法被禁用.如果它看起来很活跃,但没有互动,我会对你的应用很生气.

I'm not sure why you'd want to change this, and I don't believe it's good practice to override the visual queue for a user that something is disabled. If it looks active, but doesn't interact, I'm going to be mad at your app.

无论如何,要回答您的问题,您应该查看StateListDrawable 这个问题专门针对搜索栏进行了概述.

Regardless, to answer your question, you should look at StateListDrawable this question outlines it specifically for seek bars.

这篇关于禁用seekBar而不调光的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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