`

Styles和Themes

阅读更多

StylesThemes

 

通过指定Views的特性值,Style资源能够让应用程序保持一致的外观和感受。SytlesThemes最常用的用途是储存应用程序的颜色和字体。

 

你可以在manifest文件中,像theme一样,简单的指定不同的style来改变应用程序的外观。

 

为了创建style,使用<style/>标签,包含一个name特性以及若干个item标签。每一个item标签需要有一个name特性来指明属性(如字体大小或颜色)。item标签中应包含值,如下面的框架代码所示:

 

<?xml version=”1.0” encoding=”utf-8”?>

<resources>

<style name=”StyleName”>

<item name=”attributeName”>value</item>

</style>

</resources>

 

 

Sytles支持继承,通过在style标签里使用parent特性。

 

接下来的例子给出了两个style,当然,也可以像theme一样使用。base style设置了文本的几个属性,而第二个style改变了base style中的字体大小。

 

<?xml version=”1.0” encoding=”utf-8”?>

<resources>

<style name=”BaseText”>

<item name=”android:textSize”>14sp</item>

<item name=”android:textColor”>#111</item>

</style>

 

<style name=”SmallText” parent=”BaseText”>

<item name=”android:textSize”>8sp</item>

</style>

</resources>

 

分享到:
评论

相关推荐

    Wpf 各版本样式及模板 【Wpf themes & styles】(含framework 4.5 aero2)

    包含 .NET Framework 3.5 - 4.5 及 Silverligth PresentationFramework.dll 中的样式资源。 xaml 文件列表预览 http://my.csdn.net/my/album/detail/1309912

    VK Styles - Themes for vk.com-crx插件

    您可以分享您的主题或安装VK的vk的现成主题,从VK点击功能vk样式的完整描述:添加VC主题设置: - 接口颜色 - 颜色和文本大小 - 颜色和透明度背景,块,帽 - 菜单的颜色和背景 - 块样式:标准,圆形,没有缩进 - 彩色...

    Drupal 6 Themes: Create new themes for your Drupal 6 site with clean layout and powerful CSS styling

    * Modify the default templates and styles * Override the default templates with your own * Create dynamic styling which responds to the content or the user * Discover tools that make theming ...

    Wpf 样式和模板【 Wpf themes & styles】(含 Framework 4.5 aero2)

    资源中包括了.NET Framework 3.5、4.0、4.5 及 Silverlight 的控件样式。主要是包含在PresentationFramework程序及中的 xaml 文件,其中包括了最新的 Windows8 的主题样式 aero2.normalcolor.xaml,文件列表预览 ...

    Cool Vista-style Menu

    I based the development of this control on Vista start menu, but as you can see in the image above, it can be easily customized to support other styles, themes, etc. See demo project for more details...

    Flex关于样式专题.pdf

    关于组件中的样式定义(styles) 可以通过style 属性来更改Flex 组件的外观。这些样式属性能够定义Label 控件的字体大 小,或者Tree 控件的背景色。在Flex 中,一些样式从父...更多信息参见Using Styles and Themes.

    Android代码-自定义字体,且不需要写代码哦~

    simply add the fonts to your app, replace your views with their Font counterparts, and specify the fonts through attributes, styles and themes. All fonts are referenced into (subdirectories of) the ...

    Drupal 7 Themes

    * Find and install new themes * Get the most from Drupal’s theme configuration system * Create a new theme from scratch * Master PHPTemplate * Modify the default templates and styles * Override the ...

    WordPress Theme Design: A complete guide to creating professional WordPress themes

    * Includes a reference guide to WordPress 2.0's template hierarchy, markup, styles and template tags, as well as include and loop functions Approach: Theme design can be approached from two angles. ...

    gulp-sass-themes:编译具有不同主题(变量)文件的SASS文件

    安装 npm install gulp-sass-themes gulp-sass --save-dev基本用法源文件 ├── styles ├── body.themed.scss └── themes ├── _red.scss └── _blue.scssGulp文件 'use strict' ;const gulp = require ...

    colorThemes.zip

    visual studio主流的主题(monokai、son-of-obsidian等),都是笔者从网上搜集的。护眼主题、开发必备!

    Xtreme ToolkitPro v12.0.1零售版

    Xtreme ToolkitPro provides Windows developers with a sophisticated set of components to give applications a professional, modern appearance. Several popular visual styles and themes are included.

    瑞欣网站管理系统 v1.5 正式版.gz

    上传新版本的 ./libraries , ./modules 和 ./uploads 目录,注意备份修改过的文件,删除./styles/scripts 和 ./styles/themes目录。 移动配置文件 ./includes/profile/settings.php 到 ./includes/settings.php。 ...

    Android.application.development

    Android is an open source and Linux-based operating system for mobile devices such as smartphones and tablet computers. Android was developed by the ... Styles and Themes Chapter 19. Custom Components

    Codejock Xtreme Toolkit Pro v12.0.2零售版本包含源码

    Visual C++ / MFC 包含Source code Xtreme ToolkitPro provides Windows developers with a sophisticated set of components to give applications a ... Several popular visual styles and themes are included.

    Android代码-android-resource-navigator

    Android Resource Navigator A Google Chrome Extension providing enhanced resource navigation...Quickly open the Android framework styles or themes XML via an always available browser action button. Frame

    Android开发指南中文版

    风格与主题Styles and Themes 27 资源和资产Resources and Assets 28 资源引用Resource Reference 43 国际化和本地化Internationalization and Localization 43 意图和意图过滤器Intents and Intent Filters 43 意图...

    WPF 停靠窗口

    AvalonDock is a WPF controls library which can be used to ... It supports fly-out panes, floating windows, multiple docking manager in same window, styles and themes and it can host WinForms controls.

    Android开发宝典.rar

    风格与主题Styles and Themes 27 资源和资产Resources and Assets 28 资源引用Resource Reference 43 国际化和本地化Internationalization and Localization 43 意图和意图过滤器Intents and Intent Filters 43 ...

Global site tag (gtag.js) - Google Analytics