zoukankan      html  css  js  c++  java
  • 样式定义Android界面样式

    res/values/style.xml

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="style1">
            <item name="android:textSize">18sp</item>
            <item name="android:textColor">#EC9273</item>
        </style>
        <style name="style2">
            <item name="android:textSize">14sp</item>
            <item name="android:textColor">#FF7F7C</item>
            <item name="android:fromAlpha">0.0</item>
            <item name="android:toAlpha">0.0</item>
        </style>
    </resources>

    res/layout/main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
    <TextView 
    	style="@style/style1" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/hello"
        />
        <TextView
        style="@style/style2"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/hello"
        />
    </LinearLayout>

    运行结果
    image

  • 相关阅读:
    sql
    po bo vo java bean
    jdk面试
    Bean 参数时间 设置
    kafka demo
    spring注解 动态修改注解的值
    参考资料
    Centos 编译带调试信息的libevent
    mysql 库表整体相关查询
    MySQL安装(linux)
  • 原文地址:https://www.cnblogs.com/AlexCheng/p/2120051.html
Copyright © 2011-2022 走看看