1、定义/zhsh/res/color/txt_guide_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="@android:color/black"></item>
<item android:color="#fff"></item> </selector>

2、定义/zhsh/res/drawable/btn_guide_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button_red_pressed" android:state_pressed="true"></item>
<item android:drawable="@drawable/button_red_normal"></item> </selector>

3、修改/zhsh/res/layout/activity_guide.xml中按钮的属性

<Button
android:id="@+id/btn_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="60dp"
android:background="@drawable/btn_guide_selector"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:text="开始体验"
android:textColor="@color/txt_guide_selector"
android:visibility="gone" >
</Button>

button改变背景与文字颜色的更多相关文章

  1. Android中通过xml改变背景及文字颜色

    原创文章,转载请注明出处,谢谢! 本篇主要介绍Android开发中,通过XML资源文件来设置控件在不同状态下的背景及文字颜色.关于xml改变背景及文字颜色的原理,大家可以去看一下郭霖大神的源码分析文章 ...

  2. 设置LISTControl控件某一行的背景和文字颜色

    定义宏 用listcontrol的SetItemData设置某一行的属性,通过自定义属性标识实现. 自定义某行内容颜色属性: #define COLOR_DEFAULT 0 //默认颜色 #defin ...

  3. xml中,button改变背景颜色方法

    在画几个设置界面,用到了button控件,对于button空间的背景色在不同状态下的颜色改变方法,做了一下尝试,发现了两种背景颜色改变的方法,就总结了下. 方法一尝试了好多遍才好,要点在于,在sele ...

  4. 【转】UGUI之用脚本动态的改变Button的背景图片 和 颜色

    http://blog.csdn.net/u014771617/article/details/45102701 public Button button;void Start(){ColorBloc ...

  5. 改变页面选择文字颜色和背景颜色----selection伪元素

    div::selection{color:#fff;background: #E83E84;text-shadow:none}  

  6. SecureCR 改变背景色和文字颜色

    1.打开SecureCR链接Linux服务器,Options->Session Options->Emulation->Terminal 选择Linux (相应的服务器系统)ANSI ...

  7. android radiogroup样式(设置切换背景与文字颜色)

    main.xml <RadioGroup android:id="@+id/radioGroup1" android:layout_width="wrap_cont ...

  8. SecureCRT的背景和文字颜色的修改

    options->;session options->;emulation->;terminal选择linux(相应的服务器系统)ansi color 打上钩options-> ...

  9. 4.改变eclipse选中文字颜色

    window-preferences-general-editors-text editors-annotations-occurrences 和 window-preferences-general ...

随机推荐

  1. iOS 的 XMPPFramework 简介

    XMPPFramework是一个OS X/iOS平台的开源项目,使用Objective-C实现了XMPP协议(RFC-3920),同时还提供了用于读写XML的工具,大大简化了基于XMPP的通信应用的开 ...

  2. 2.TCP_IP互联线缆_TCP_UDP报文抓包详解

    TCP_IP互联线缆_TCP_UDP报文抓包详解 2.1网线标准 直通线 交叉线 异种设备互联使用直通线 同种设备互联使用交叉线 TCP和UDP 端口寻址 TCP数据格式 TCP三次握手 UDP数据格 ...

  3. windows系统下利用MySql命令行进入MySql数据库

    Enter password: ****

  4. Power-BI:从5方面助力您企业的发展

    商务智能让企业得以使用自己的数据来预测销量趋势.分析ROI.追踪收益.做出更明智的产品和服务决策.商务智能可从5个方面让您成为“数据之星”,为您发展企业: 1.关注企业成长.而非数据 优质的BI工具最 ...

  5. webconfig和appconfig中出现特殊字符如何处理

    在配置文件出现特殊字符&的字符串(如:abce&efg),就会报错.错误如下: 如何处理呢? config文件的本质是xml,所以必须符合xml的规范我们需要这么处理: abce&am ...

  6. Java遇见HTML——JSP篇之JSP指令与动作元素

    一.include指令(如:<%@include file="..."%> ) 示例: Date.jsp <%@page import="java.te ...

  7. 字符串拷贝函数strcpy写法_转

    Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> ...

  8. [g2o]一个备忘

    g2o使用的一个备忘 位姿已知,闭环的帧已知,进行图优化. #include "stdafx.h" #include <vector> #include "P ...

  9. iOS TPKeyboardAvoiding自动识别键盘的高度

                     #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicatio ...

  10. openvpn构建

    openvpn构建1. 检测是否支持tun/tap cat /dev/net/tun cat: /dev/net/tun: File descriptor in bad state ##这代表支持 2 ...