使用sencha-touch控件制作布局的平板电脑界面
2011-11-02 22:27
375 查看
P.S由于国内twitter上不去,所以没有数据显示
效果如下:
html页面上的js引用:
index.js中代码
效果如下:
html页面上的js引用:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title id="page-title">Pandora</title> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;" /> <link rel="stylesheet" href="touch/resources/css/sencha-touch.css" type="text/css"/> <!--<script type="text/javascript" src="/Scripts/jquery-1.4.4.min.js"></script>--> <script type="text/javascript" src="touch/sencha-touch-all.js"></script> <script type="text/javascript" src="app/view/index.js"></script> </head> <body> </body> </html>
index.js中代码
Ext.application({ name: 'Sencha', launch: function () { Ext.regModel('Tweet', { fields: [{ name: 'id', type: 'int' }, { name: 'profile_image_url', type: 'string' }, { name: 'from_user', type: 'string' }, { name: 'text', type: 'string' }] }); var store = new Ext.data.Store({ model: 'Tweet', proxy: { url: 'http://search.twitter.com/search.json', type: 'scripttag', extraParams: { rpp: 50, suppress_response_codes: true }, reader: { root: 'results' } } }); store.getProxy().extraParams.q = 'ipad'; store.read(); Ext.create('Ext.Container', { fullscreen: true, layout: 'hbox', items: [ { xtype: 'toolbar', docked: 'top', height: 50, scrollable: { direction: 'horizontal', indicators: false }, items: [ { ui: 'back', text: 'Back' }, { text: 'Default' }, { ui: 'round', text: 'Round' }, { xtype: 'spacer' }, { xtype: 'segmentedbutton', items: [ { text: 'Option 1' }, { text: 'Option 2', pressed: true }, { text: 'Option 3' } ] }, { xtype: 'spacer' }, { ui: 'action', text: 'Action' }, { ui: 'forward', text: 'Forward' }, { xtype: 'segmentedbutton', allowMultiple: true, items: [ { text: 'Toggle 1', pressed: true }, { text: 'Toggle 2', pressed: true }, { text: 'Toggle 3' } ] } ] }, { xtype: 'list', disclosure: true, onItemDisclosure: { scope: 'test', handler: function (record, btn, index) { store.getProxy().extraParams.q = 'ipad'; store.read(); } }, itemSelector: '.tweet', tpl: '<tpl for="."><div class="tweet">{id} - {from_user}</div></tpl>', store: store, flex: 1 }, { xtype: 'panel', html: 'message preview', flex: 2 } ] }); //Ext.Viewport.add(panel); } });
相关文章推荐
- 如何使用sencha-touch控件显示平板上的tab界面
- sencha-touch 1.1 Picker控件使用
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- 分享-WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- [转]WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- Android——使用GridView制作二维布局界面(行、列分布)
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- python使用wx绘界面,布局自已的toolbar,使控件右对齐
- Cocos2d-x 3.0 开发(十五)使用UILayout布局,制作对话界面
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- [Phonegap+Sencha Touch] 移动开发39 某些安卓手机的webview使用location.href="tel:123456"不能调到打电话的界面
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
- 使用sencha touch控件制作list界面
- Winform- 界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用