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>
  • 相关阅读:
    别以为真懂Openstack: 虚拟机创建的50个步骤和100个知识点(3)
    别以为真懂Openstack: 虚拟机创建的50个步骤和100个知识点(2)
    别以为真懂Openstack: 虚拟机创建的50个步骤和100个知识点(1)
    High Availability手册(3): 配置
    High Availability手册(2): 架构
    High Availability手册(1): 环境
    Data Center(5): 实例
    Data Center手册(4):设计
    Data Center手册(3): Load Balancer
    了解美杜莎(Medusa)
  • 原文地址:https://www.cnblogs.com/excellencesy/p/9036078.html
Copyright © 2011-2022 走看看