Android:在自定义按钮中使用默认高亮显示颜色 [英] Android: Use default highlight colors in a custom button

查看:422
本文介绍了Android:在自定义按钮中使用默认高亮显示颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Android应用程序中使用一个按钮,但我想自定义它的外观。但是,我希望按钮的突出显示和选择的颜色与默认颜色相同(即,深色和浅橙色渐变,或任何主题颜色)。

I want to use a Button in my android app but I want to customize how it looks. However, I want the highlight and selected colors of the button to be the same as the default colors (i.e. the dark and light orange gradients, or whatever the theme color supplies).

有没有反正要获得默认的高亮/选择的可绘制,并使用它作为我的按钮在选定和高亮状态的填充?

Is there anyway to get the default highlight/selected drawables and to use that as the fill for my buttons on the selected and highlighted states?

谢谢! >

Thanks!

推荐答案

你需要两个不同的东西,你想要drawables或colorcode吗?

You are asking for two different things, do you want the drawables or the colorcode?

无论如何,您可以在这里找到drawables的名称: http://androiddrawableexplorer.appspot.com/
我不知道你是否可以直接从你的应用程序中使用它们,或者你必须首先将它们保存到你的drawables文件夹,但你可以在你的sdk中找到它们。如果你想要的颜色代码,使用gimp从图片中提取它们。

Anyway, you can find the name of the drawables here: http://androiddrawableexplorer.appspot.com/ I don't know if you can use them directly from your app or if you have to save them to your drawables folder first, but you can find them in your sdk. If you want the colorcodes, use gimp to extract them from the pictures.

这篇关于Android:在自定义按钮中使用默认高亮显示颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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