1,037
社区成员
这是我参加朝闻道知识分享大赛的106 篇文 章
1. app.json 3) win dow属性
属性名称 |
类型 |
默认值 |
解释 |
navigationBar BackgroundColor |
HexColor |
#000000 |
导航栏背景颜色,默认值表示黑色,也可以简写为#000 |
navigationBarTextStyle |
String |
white |
导航栏标题颜色,默认值表示白色,该属性值只能是white或black |
navigationBarTitleText |
String |
|
导航栏标题文字内容,默认为无文字内容 |
navigationStyle |
String |
default |
导航栏样式,只支持default或custom;其中custom用于自定义导航栏内容,只保留右上角的小图标(iOS/Android微信版本6.6.0以上支持此功能) |
backgroundColor |
HexColor |
#ffffff |
窗口的背景颜色,默认值表示白色,也可以简写为#fff |
backgroundTextStyle |
String |
dark |
下拉加载的样式,该属性值只能是dark或light |
backgroundColorTop |
String |
#ffffff |
顶部窗口的背景颜色,只有iOS有效(微信版本6.5.16以上支持此功能) |
backgroundColorBottom |
String |
#ffffff |
底部窗口的背景颜色,只有iOS有效(微信版本6.5.16以上支持此功能) |
enablePullDownRefresh |
Boolean |
false |
是否开启下拉刷新功能 |
onReachBottomDistance |
Number |
50 |
页面上拉触底事件触发时距页面底部距离,单位为像素px |
3) window 属性 修改后的预览效果如 图所示。 开发者可以根据 实际需要,重新修改定义window属性中的各种样式效果。
4) tabBar属性 如果小程序是一个多 t ab 应用(客户端窗口的底部有 ta b 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面。
属性 |
类型 |
必填 |
默认值 |
描述 |
color |
HexColor |
是 |
|
tab 上的文字默认颜色 |
selectedColor |
HexColor |
是 |
|
tab 上的文字选中时的颜色 |
backgroundColor |
HexColor |
是 |
|
tab 的背景色 |
borderStyle |
String |
否 |
black |
tabbar上边框的颜色, 仅支持 black / white |
list |
Array |
是 |
|
tab 的列表 |
position |
String |
否 |
bottom |
tabBar的位置,仅支持 bottom / top |
4) tabBar属性 其中 list 接受一个数组, 只 能配置 最少2个、 最多5个 tab。 tab 按数组的顺序排序,每个项都是一个对象。
属性 |
类型 |
必填 |
说明 |
pagePath |
String |
是 |
页面路径,必须在 pages 中先定义 |
text |
String |
是 |
tab 上按钮文字 |
iconPath |
String |
否 |
图标路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,不支持网络图片 |
selectedIconPath |
String |
否 |
选中时的图标路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,不支持网络图片 |
注:当 postion 属性 值为 top 时,iconP ath和selectedIconPath属性无效,不 显示图标。