承德网站建设设计,网站开发工程师是什么内容,创意广告牌设计图片大全,重庆视频制作公司排名原文#xff1a;Sencha Ext JS 5: Supporting Different Themes for Different Devices 步骤1创建一个应用程序步骤2定义主题步骤3编辑Appjson文件以便支持多平台生成步骤4编辑output定义以便创建多个应用程序的manifests步骤5更新应用程序步骤6替换Appjson中的CSS配置步骤7替… 原文Sencha Ext JS 5: Supporting Different Themes for Different Devices 步骤1创建一个应用程序步骤2定义主题步骤3编辑Appjson文件以便支持多平台生成步骤4编辑output定义以便创建多个应用程序的manifests步骤5更新应用程序步骤6替换Appjson中的CSS配置步骤7替换bootstrap属性以便加载appropriate manifest文件步骤8在indexhtml文件中在微加载之上添加以下代码到一个script标记中以加载appropriate manifest步骤9生成应用程序步骤10在桌面或移动设备浏览器上测试应用程序 Sencha Ext JS 5是第一个完全支持iOS平板的Ext框架。 为应用程序添加平板支持并能根据使用的设备自动切换桌面或基于触碰的主题CSS文件可能是相当重要的任务。 本教程将演示如何将该功能添加到应用程序。 步骤1创建一个应用程序 在Ext JS 5文件夹打开命令行提示符运行以下命令 sencha generate app TestApp ../TestApp步骤2定义主题 在命令行提示符切换到TestApp目录运行以下命令 sencha generate theme TestApp-Desktop注为桌面创建主题sencha generate theme TestApp-Tablet注为平板创建主题在编辑器打开 /TestApp/packages/TestApp-Desktop/package.json修改“extend”属性为“extend ext-theme-neptune”保存文件在编辑器打开/TestApp/packages/TestApp-Tablet/package.json将“extend”属性从ext-theme-classic修改ext-theme-neptune-touch步骤3编辑App.json文件以便支持多平台生成 在编辑器打开 /TestApp/app.json添加“builds”属性作为指示builds: {testAppDesktop: {theme: TestApp-Desktop},testAppTouch: {theme: TestApp-Tablet}
} 步骤4编辑output定义以便创建多个应用程序的manifests 使用以下代码替换app.json中的output配置 output: {base: ${workspace.build.dir}/${build.environment}/${app.name}/${build.id},page: ./index.html,manifest: ../${build.id}.json,deltas: {enable: false},cache: {enable: false}
} 步骤5更新应用程序 返回命令行提示符输入以下命令 sencha app refresh 这将生产manifest文件testAppDesktop.json和testAppTouch.json 步骤6替换App.json中的CSS配置 使用以下代码替换App.json中的css配置 css: [{path: ${build.out.css.dir}/TestApp-all.css,bootstrap: true}] 步骤7替换bootstrap属性以便加载appropriate manifest文件 bootstrap: {manifest: ${build.id}.json
} 步骤8在index.html文件中在微加载之上添加以下代码到一个script标记中以加载appropriate manifest: var Ext Ext || {};
Ext.beforeLoad function(tags){ var theme location.href.match(/theme([\w-])/);theme (theme amp;amp; theme[1]) || (tags.desktop ? testAppDesktop : testAppTouch);Ext.manifest theme;tags.test /testModetrue/.test(location.search);Ext.microloaderTags tags;
}; 步骤9生成应用程序 返回命令行提示符并输入以下命令 sencha app build development 步骤10在桌面或移动设备浏览器上测试应用程序 转载于:https://www.cnblogs.com/muyuge/p/6333637.html