zoukankan      html  css  js  c++  java
  • 聚焦改变字体,背景颜色

    聚焦改变背景色

    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" android:drawable="@color/red"></item>
    </selector>
     <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="hahah"
            android:background="@drawable/tc1"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/tc1"
            android:textColor="@drawable/tc1"/>

     改变字体颜色

    <resources>
    
        <!-- Base application theme. -->
        <!--<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
        <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
            <!-- Customize your theme here. -->
            <item name="colorPrimary">@color/colorPrimary</item>
            <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
            <item name="colorAccent">@color/colorAccent</item>
        </style>
        <style name="style1">
            <item name="android:textSize">25dp</item>
        </style>
        <style name="style2" parent="style1">
        </style>
    </resources>
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:orientation="vertical"
        android:paddingTop="@dimen/activity_vertical_margin"
        tools:context="helloworld.com.inspur.demo8.MainActivity">
    
        <!--<TextView
            style="@style/style1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@drawable/tc1"
            android:text="haah"
            android:id="@+id/tv1"/>
        <TextView
            style="@style/style1"
            android:text="haah"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/tv2"/>-->
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="hahah"
            android:textColor="@drawable/tc1"/>
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="hahah"
            android:textColor="@drawable/tc1"
            />
    
      <!--  <ListView
            android:id="@+id/lv"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           />-->
    <!--<Button
        android:background="@drawable/bt1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />-->
    </LinearLayout>
  • 相关阅读:
    读取web.xml中设置的参数
    在服务端中,读取properties资源文件中的数据
    window下,nodejs安装http-server,并开启HTTP服务器
    跨域请求资源的方式
    IView 给Submenu增加click事件失效解决方案
    Vue -- mounted方法中调用methods的方法(并取出mounted方法中回调函数的值)
    IView 使用Table组件时实现给某一列添加click事件
    物联网协议CoAP协议学习
    电脑操作
    物联网协议
  • 原文地址:https://www.cnblogs.com/excellencesy/p/9036078.html
Copyright © 2011-2022 走看看