zoukankan      html  css  js  c++  java
  • android样式跟主题

    简单说类似与自定义控件,只不过自定义控件针对的是view 而样式与主题针对的是属性、元素

    在TexvView中引入样式

    layout.xml

    复制代码
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <TextView
            style="@style/text_content_style"
            android:text="haha" />
    
        <TextView
            style="@style/text_content_style"
            android:text="gaga" />
    
        <TextView
           
            style="@style/text_red_content_style"
            android:text="guagua" />
    
    </LinearLayout>
    复制代码

    引入的样式的.xml

    复制代码
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    
        <style name="text_content_style">
            <item name="android:layout_width">wrap_content</item>
            <item name="android:layout_height">wrap_content</item>
            <item name="android:textColor">#66ff00</item>
            <item name="android:textSize">28sp</item>
        </style>
    
        <style name="text_red_content_style" parent="@style/text_content_style">
            <item name="android:textColor">#ff0000</item>
        </style>
        <style name="activity_bg_theme">
            <item name="android:background">#ff0000</item>
            <item name="android:windowFullscreen">true</item>
        </style>
      
    
    </resources>
    复制代码
  • 相关阅读:
    使用keepalived监控tomcat 达到双机热备
    nginx tomcat负载均衡 使用redis session共享
    Java线程安全和非线程安全
    Log4J日志配置详解
    使用java mail的网易smtp协议 发送邮件
    JavaScript-DOM(3)
    JavaScript-DOM(2)
    JavaScript-DOM(1)
    BOM简介
    JavaScript(数组、Date、正则)
  • 原文地址:https://www.cnblogs.com/fx2008/p/3140840.html
Copyright © 2011-2022 走看看