• 聚焦改变字体,背景颜色


    聚焦改变背景色

    <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>
  • 相关阅读:
    类型构造器
    WIN32画图窗口
    WIN32创建进程CreateProcess
    WIN通过消息实现互斥同步CreateEvent和SetEvent
    WIN32生产消费经典同步但是以消耗时间为代价
    WIN32互斥体CreateMutex以及限制多开
    WIN32临界区线程锁EnterCriticalSection和LeaveCriticalSection
    GetThreadContext和SetThreadContext
    远程线程注入
    EnumProcessModules 使用 获取进程的路径
  • 原文地址:https://www.cnblogs.com/excellencesy/p/9036078.html
Copyright © 2020-2023  润新知