Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android颜色背景转换,如css_Android_Css_Android Activity_Background Color - Fatal编程技术网

Android颜色背景转换,如css

Android颜色背景转换,如css,android,css,android-activity,background-color,Android,Css,Android Activity,Background Color,我需要使我的活动的背景颜色在程序上稍有不同,我有一个css示例: <html> <head> <style type="text/css"> div{ width: 150px; height: 150px; background-color: #343; transition: ease all 0.5s; } div:hover{ background-color: #

我需要使我的活动的背景颜色在程序上稍有不同,我有一个css示例:

<html>
<head>
<style type="text/css">
   div{
       width: 150px;
       height: 150px;
       background-color: #343;
       transition: ease all 0.5s;
   }
   div:hover{
       background-color: #ccc;
   }    
</style>
</head>
<body>
    <div> </div>
</body>
</html>
请将鼠标悬停在div上,有人知道当用户点击按钮时,我怎样才能达到同样的效果

考虑可用性是个坏主意

谢谢。

使用jquery toggleClass您可以轻松实现这一点。您是说这个吗?点击这个?使用JavaScript:可能是您正在寻找的