- Sencha Touch 教程
- Sencha Touch - 首页
- Sencha Touch - 概述
- Sencha Touch - 环境
- Sencha Touch - 命名规范
- Sencha Touch - 架构
- Sencha Touch - MVC 解释
- Sencha Touch - 第一个应用
- Sencha Touch - 构建应用程序
- Sencha Touch - 迁移步骤
- Sencha Touch - 核心概念
- Sencha Touch - 数据
- Sencha Touch - 主题
- Sencha Touch - 设备配置文件
- Sencha Touch - 依赖项
- 环境检测
- Sencha Touch - 事件
- Sencha Touch - 布局
- Sencha Touch - 历史和支持
- Sencha Touch - 上传和下载
- Sencha Touch - 视图组件
- Sencha Touch - 打包
- Sencha Touch - 最佳实践
- Sencha Touch 有用资源
- Sencha Touch - 快速指南
- Sencha Touch - 有用资源
- Sencha Touch - 讨论
Sencha Touch - 主题
Sencha Touch 提供了许多主题可用于您的应用程序。您可以添加不同的主题来代替经典主题,并根据我们用于应用程序的设备查看输出的差异。这只需替换主题 CSS 文件即可完成,如下例所示。
桌面主题
考虑您第一个 Hello World 应用程序。应用程序中的以下 CSS 用于桌面主题。
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css
要查看效果,请尝试以下程序 -
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css" rel = "stylesheet" />
<script type="text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script>
<script type = "text/javascript">
Ext.application({
name: 'Sencha',
launch: function() {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
items: [{
title: 'Home',
iconCls: 'home',
html: 'Welcome to sencha touch'
}]
});
}
});
</script>
</head>
</html>
这将产生以下结果 -
Windows 主题
考虑您第一个 Hello World 应用程序。从应用程序中删除以下 CSS -
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css
添加以下 CSS 以使用 Windows 主题。
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/wp.css
要查看效果,请尝试以下程序 -
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/wp.css" rel = "stylesheet" />
<script type = "text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script>
<script type = "text/javascript">
Ext.application({
name: 'Sencha',
launch: function() {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
items: [{
title: 'Home',
iconCls: 'home',
html: 'Welcome to sencha touch'
}]
});
}
});
</script>
</head>
</html>
这将产生以下结果 -
IOS 主题
考虑您第一个 Hello World 应用程序。从应用程序中删除以下 CSS。
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css
添加以下 CSS 以使用 Windows 主题
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/cupertino.css
要查看效果,请尝试以下程序 -
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/cupertino.css" rel = "stylesheet" />
<script type = "text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script>
<script type = "text/javascript">
Ext.application({
name: 'Sencha',
launch: function() {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
items: [{
title: 'Home',
iconCls: 'home',
html: 'Welcome to sencha touch'
}]
});
}
});
</script>
</head>
</html>
这将产生以下结果 -
IOS 经典主题
考虑您第一个 Hello World 应用程序。从应用程序中删除以下 CSS -
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css
添加以下 CSS 以使用 Windows 主题 -
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/cupertino-classic.css
要查看效果,请尝试以下程序 -
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/cupertino-classic.css" rel = "stylesheet" />
<script type = "text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script>
<script type = "text/javascript">
Ext.application({
name: 'Sencha',
launch: function() {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
items: [{
title: 'Home',
iconCls: 'home',
html: 'Welcome to sencha touch'
}]
});
}
});
</script>
</head>
</html>
这将产生以下结果 -
Android 主题
考虑您第一个 Hello World 应用程序。从应用程序中删除以下 CSS。
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css
添加以下 CSS 以使用 Windows 主题。
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/mountainview.css
要查看效果,请尝试以下程序 -
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/mountainview.css" rel = "stylesheet" />
<script type = "text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script>
<script type = "text/javascript">
Ext.application({
name: 'Sencha',
launch: function() {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
items: [{
title: 'Home',
iconCls: 'home',
html: 'Welcome to sencha touch'
}]
});
}
});
</script>
</head>
</html>
这将产生以下结果 -
BlackBerry 主题
考虑您第一个 Hello World 应用程序。从应用程序中删除以下 CSS。
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/sencha-touch.css
添加以下 CSS 以使用 Windows 主题。
https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/bb10.css
要查看效果,请尝试以下程序 -
<!DOCTYPE html>
<html>
<head>
<link href = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/resources/css/bb10.css" rel = "stylesheet" />
<script type = "text/javascript" src = "https://cdn.sencha.com/touch/sencha-touch-2.4.2/sencha-touch-all.js"></script>
<script type = "text/javascript">
Ext.application({
name: 'Sencha',
launch: function() {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
items: [{
title: 'Home',
iconCls: 'home',
html: 'Welcome to sencha touch'
}]
});
}
});
</script>
</head>
</html>
这将产生以下结果 -
广告