api 编辑 index.html,index.html

Hello APP

html,

body {

height: 100%;

}

.wrap {

display: -webkit-box;

-webkit-box-orient: vertical;

-webkit-flex-flow: column;

}

header {

height: 44px;

width: 100%;

text-align: center;

background-color: #81a9c3;

color: #fff;

line-height: 44px;

font-size: 20px;

}

.flex-1 {

-webkit-box-flex: 1;

-webkit-flex: 1;

}

footer {

height: 30px;

width: 100%;

background-color: #81a9c3;

color: white;

line-height: 30px;

text-align: center;

}

APICloud

Copyright ©

apiready = function() {

//输出Log,Log将显示在APICloud Studio控制台

console.log("Hello World! Hello APICloud!");

var header = $api.dom('header'); // 获取 header 标签元素

var footer = $api.dom('footer'); // 获取 footer 标签元素

// 1.修复开启沉浸式效果带来的顶部Header与手机状态栏重合的问题,最新api.js方法已支持适配iPhoneX;

// 2.默认已开启了沉浸式效果 config.xml中

// 3.沉浸式效果适配支持iOS7+,Android4.4+以上版本

var headerH = $api.fixStatusBar(header);

// 最新api.js为了适配iPhoneX增加的方法,修复底部Footer部分与iPhoneX的底部虚拟横条键重叠的问题;

var footerH = $api.fixTabBar(footer);

api.openFrame({

name: 'main',

url: 'html/main.html',

bounces: true,

rect: { // 推荐使用Margin布局,用于适配屏幕的动态变化

marginTop: headerH, // main页面距离win顶部的高度

marginBottom: footerH, // main页面距离win底部的高度

w: 'auto' // main页面的宽度 自适应屏幕宽度

}

});

// 获取当前年份时间,并加载显示到页面

var year = $api.byId('year');

year.innerHTML = new Date().getFullYear();

};

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值