Fiori2.0学习笔记-Pages&panels
来源:互联网 发布:淘宝2015版本下载安装 编辑:程序博客网 时间:2024/05/22 12:55
SAPUI5常用布局有两种
Page布局 由头部、副标题、内容区域和尾部四部分组成
Panel布局 由若干个标题+展开收起内容组成
page的常用属性及事件
showNavButton 是否显示返回按钮
showHeader、showFooter 是否显示Header、Footer
navButtonPress 按钮点击事件
floatingFooter 使footer浮动起来
contentOnlyBusy true局部的loading false全局的loading
busyIndicatorDelay loading延迟时间,若不设置会默认2s的等待时间
enableScrolling 判断当前页面允不允许滚动
navButtonTooltip 按钮提示
标签内可以为header设置多个按钮
标签内可以设置一个搜索框SearchField
下面是Page的view页,具体的属性上面都有
补充一点:在page标签加上navButtonTap编辑器会显示报错,但依然可以跑起来,这是因为这个方法在1.12.2版本后就不用了,用navButtonPress代替了。因为版本更新,有很多属性和方法都被deprecated掉了,就是新版本开始不用了,但是不会影响页面加载
<App> <pages> <Page id="myPage" title="page" class="sapUiContentPadding" showNavButton="true" showHeader="true" showFooter="true" navButtonPress="onBack" floatingFooter="true" enableScrolling="true" navButtonTap="Last Page"> <headerContent> <Button icon="sap-icon://action" tooltip="share" press="showLoading"/> </headerContent> <subHeader> <Toolbar> <SearchField/> </Toolbar> </subHeader> <content> <VBox> <Text text="Before you start using SAPUI5 , please read the important information in the section. Here you read everything you need to know about supported library combinations, the supported browsers and platforms, and so on."/> </VBox> <VBox id="After"> <Text text="After you start using SAPUI5 , please read the important information in the section. Here you read everything you need to know about supported library combinations, the supported browsers and platforms, and so on."/> </VBox> <VBox> <Text text="Before you start using SAPUI5 , please read the important information in the section. Here you read everything you need to know about supported library combinations, the supported browsers and platforms, and so on."/> </VBox> </content> <footer> <Toolbar> <ToolbarSpacer/> <Button text="Accept" type="Accept"/> <Button text="Reject" type="Reject"/> <Button text="Enit" /> <Button text="Delect" type="Default"/> </Toolbar> </footer></Page></pages>
下面我们实现一下onBack这个点击事件
onBack:function(event){ var myPage = this.getView().byId('myPage');//获取当前页 // myPage.scrollTo(0,1000);//自动跳转到头部位置,第二个数字是秒数 var After = this.getView().byId('After');//获取到ID为After myPage.scrollToElement(After,200);//跳转到ID的位置}
实现Loading
showLoading:function(){ var myPage = this.getView().byId('myPage'); myPage.setBusy(true);}
panel的常用属性
expandable 当前panel是否可以展开
expanded 默认情况下panel是展开还是关闭
headerText panel标题,但是不推荐使用这个方式,因为这个方式只能加一个标题,不能更加丰富,所以我们一般都用toolbar
下面是一个demo。
其中可以注意一点 就是这个panel不需要APP这个容器,加上反而会导致显示不全。这点编者也他妈不明白,明明就是个m库下的东西还不需要容器,加了容器反而报错。
<Panel expandable="true" expanded="true" width="auto" class="sapUiResponsiveMargin"> <content> <Text text="fore you start using SAPUI5 , please read the important information in the section. Here you read everything you need to know about supported library combinations, the supported browsers and platforms, and so on."/> </content></Panel> <Panel expandable="true" expanded="false" width="auto" class="sapUiResponsiveMargin"> <headerToolbar> <Toolbar> <Title text="Coumnl the row"/> <ToolbarSpacer/> <Button icon="sap-icon://settings"/> <Button icon="sap-icon://drop-down-list"/> </Toolbar> </headerToolbar> <content> <Text text="Before you start using SAPUI5 , please read the important information in the section. Here you read everything you need to know about supported library combinations, the supported browsers and platforms, and so on."/> </content></Panel>
- Fiori2.0学习笔记-Pages&panels
- Fiori2.0学习笔记-GATEWAY
- Fiori2.0学习笔记-controller
- Fiori2.0学习笔记-modules
- Fiori2.0学习笔记-splitApp
- Fiori2.0学习笔记-Fragment
- Fiori2.0学习笔记-JSONModel
- Fiori2.0学习笔记-Manifest
- Fiori2.0学习笔记-路由导航
- Fiori2.0学习笔记-事件的处理
- Fiori2.0学习笔记-dialog应用
- Fiori2.0学习笔记-OData(new)
- Fiori2.0学习笔记-数据绑定
- Fiori2.0学习笔记-OData的应用
- Fiori2.0学习笔记-Ajax数据请求
- Fiori2.0学习笔记-问题汇总
- Fiori2.0学习笔记-BUG汇总
- Fiori2.0学习笔记-核心技术框架&基本项目结构
- 百度云操作系统默认被安装软件
- rpmbuild ERROR: No build ID note found in
- Android Monkey 压力测试 介绍
- JAVA8新特性之Stream如何“骚”起来
- Perfect Cut 5.0 玻璃优化软件\
- Fiori2.0学习笔记-Pages&panels
- jni使用openssl AES256位加解密(cbc模式),匹配java后端服务器算法,解决末尾乱码问题
- Java Web学习之旅开始
- MD5加密之简单程序
- 教程篇(5.4) NSE4 16. 高级IPsec VPN ❀ 飞塔 (Fortinet) 网络安全专家
- Python与MySQL交互之用户登录
- 单例模式简单实例
- 1.1.2 编程的开始
- XGTD v2.1 1CD(电磁仿真和分析软件)\