博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Styles and Themes
阅读量:6316 次
发布时间:2019-06-22

本文共 1514 字,大约阅读时间需要 5 分钟。

A style is a collections of properties that specify the look and format of a view or window.

They allow to separate the design from the content.

Without Style XML, we can design it in the Layout XML:

With Style XML, we can turn it to:

A theme is a style applied to an entire Activity of Application, rather than an individual view.

When a style is applied as a theme, every View in the Activity or application will apply each style property that it supports.

Then add an <item> element for each property of that style, with a name that declares the style property  and a value to go with it.

 

Defining Styles

The root node of the XML file must be <resources>.

For each style you want to create, add a <style> element to the file with a name that uniquely identifies the style.

Each child of the <resource> element  is converted into an application resource object at compile-time.

Example:

   
 
Inheritance
The parent attribute in the 
Example
 
Style properties
The best place to find properties that apply to a specific View is the corresponding class reference, which lists all of the supported attributes.
Example

   ↳android.R.attr

public static final int textColor

Added in

Color of text (usually same as colorForeground).

May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

Constant Value: 16842904 (0x01010098)

转载地址:http://mekaa.baihongyu.com/

你可能感兴趣的文章
软件需求分析的重要性
查看>>
UVA465:Overflow
查看>>
HTML5-placeholder属性
查看>>
Android选择本地图片过大程序停止的经历
查看>>
poj 2187:Beauty Contest(旋转卡壳)
查看>>
《Flask Web开发》里的坑
查看>>
Python-库安装
查看>>
Git笔记
查看>>
普通人如何从平庸到优秀,在到卓越
查看>>
SLAM数据集
查看>>
c#学习笔记05——数组&集合
查看>>
【图论算法】Dijstra&BFS
查看>>
注册和上传文件(头像)
查看>>
使用OVS
查看>>
键盘回收的几种方法
查看>>
Python(条件判断和循环)
查看>>
day4 linux安装python
查看>>
LeetCode Container With Most Water (Two Pointers)
查看>>
vue (v-if show 问题)
查看>>
https基础
查看>>