首先要配置开发环境。
这个很简单,只要到官方网站下载sencha-touch压缩包即可 http://www.sencha.com/products/touch/。
开发工具随便一个编辑器,记事本也可以的。
本人用的是myEclipse+tomcat,sencha-touch用的是1.01版本
(使用myEclipse+tomcat我为了以后例子可以跟后台交互)
其实可以直接浏览本地静态html文件的。
1,编写messageBox.html文件:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>messageBox.html</title>
<link rel="stylesheet" href="../../ext/resources/css/sencha-touch.css" type="text/css">
<script type="text/javascript" src="../../ext/sencha-touch.js"></script>
<script type="text/javascript" src="messageBox.js"></script>
</head>
<body>
</body>
</html>
如果你以前用过Extjs,那么这段代码你很容易明白。
1,引入sencha-touch.css样式文件。
2,引入sencha-touch.js核心库文件。
3,messageBox.js是例子用的文件。
2,编写messageBox.js文件:
Ext.setup({
icon: '../icon.png',
tabletStartupScreen: '../tablet_startup.png',
phoneStartupScreen: '../phone_startup.png',
glossOnIcon: false,
onReady: function() {
Ext.Msg.alert('提示', '第一个SenchaTouch程序!');
}
});
现在我们只关心onReady函数里面的代码,其他可以copy。
如果你以前做过Extjs那么看API难不到你。你可以在onReady中使用其他组件进行测试的。
3,运行效果:
本人使用的是Opera的手机模拟器(支持HTML5),google浏览器也可以的。
在浏览器输入http://localhost:8080/SenchaTouchTest/myExample/messageBox/messageBox.html
当然你可以直接打开html进行浏览而不必要部署到服务器(我为了以后例子可以跟后台交互)
- 大小: 31.3 KB
- 大小: 29.5 KB
分享到:
相关推荐
sencha-touch下载
sencha-touch-2.3.1-gpl.zip
sencha touch完整包(试用版)中的grid代码,位置在 touch-2.3.n > packages > sencha-touch-grid 使用时放到 ../MyApp/packages下 TouchGrid gives you a grid feature to arrange information in rows and columns...
sencha-touch demo里面包含着基本常用的 phonegap-1.2.0.js index.html sencha-touch.css sencha-touch-all.js 等常用文件
sencha-touch手机平板开发
官方sencha-touch最新版本2.0.0(附文档和实例),喜欢移动web开发的童鞋快来下载吧,免费噢,一起交流!!
sencha-touch 移动开发sencha-touch 移动开发sencha-touch 移动开发
Sencha Touch是移动HTML5开发框架,构建用于iPhone、Android 和Window Phone等跨平台的移动应用程序.
sencha-touch-2.1.0-gpl.zip 官网下载的,欢迎下载
sencha-touch-2.0 jar包,基于html5新技术,extjs的发展,可在移动设备上浏览实现iphone效果的服务端技术
Sencha-touch开发环境准备,介绍如何安装,设置环境变量等等。
sencha-touch-2.1.0-gpl
sencha-touch 1.0 所有文档 sencha-touch 2.0 API(docs说明) 案例
sencha-touch-2.0.0-commercial
sencha-touch grid 最新的代码
sencha-touch + cordova(PhoneGap)使用adt-eclipse打包实例
sencha-touch-2.0.0-commercial
sencha-touch-2.0.0-pr1.zip
sencha-touch-2-b3
关于js框架sencha-touch2.0的一个记事本的小例子。