配置

系统设置,可以通过t.setting(params)进行配置。例如

    t.setting({autoload: false});

配置参数:

参数名称 类型 默认 描述
root string index.html 首页地址,用于自动返回功能时,最后返回地址。
cache boolean true 预留字段
autoload boolean false 自动预加载开关,如开启此功能,会预先加载下一页的内容,默认为true开启自动加载功能。`此功能已经弃用`
async boolean false 异步加载开关,如开启此功能,会异步加载调用或加载内容,默认为false关闭。
env boolean true 是否开启调试环境
preload boolean true 页面间过度动画开关,如开启此功能,当访问新页面或返回原页面的时候,如果有网络延迟,会出现等待动画,默认开启。
animation boolean false 页面动画效果开关,安卓手机一般为关闭false,ios为true。以前的安卓手机会有卡顿现象,根据具体情况选择开关。
rightTouch boolean false 右滑动返回上一页开关,注意如开启此功能,要保证页面中没有相关右滑动的ui,否则会有冲突,默认关闭。

Hbuilder中配置动画开关实例

	document.addEventListener("plusready", function() {
	    //判断如果是ios系统,开启页面滑动动画。
		if(plus.os.name.toLocaleLowerCase() == "ios"){
			t.setting({preload: true, animation: true});
		}
	});

风格配置: 风格参数:

参数名称 类型 默认 描述
navbgColor string #2196f3 顶部背景颜色
radioActiveColor string #333 单选背景颜色
checkboxActiveColor string #333 多选背景颜色
tabActiveColor string #2196f3 顶部和底部导航背景颜色

风格初始化:

    t.styles = {
        navbgColor: "#2196f3",
        radioActiveColor: "#333",
        checkboxActiveColor: "#333",
        tabActiveColor: "#2196f3"
    }