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

  • 相关阅读:
    图形
    附属信息
    文件操作
    字符编码
    Python数据类型之基础记。。。
    python并发编程之多进程
    python并发编程之多进程
    计算机基础之计算机系统的简单了解。
    元类
    基于socketserver模块实现并发tcp/udp
  • 原文地址:https://www.cnblogs.com/AlexCheng/p/2120051.html
Copyright © 2011-2022 走看看