Android配置项说明。调用示例:{
uiConfig: {
setNavHidden: "false",
setLogoHidden: "false",
setSloganHidden: "false",
setCheckboxHidden: "false",
setSwitchHidden: "true",
//授权页Loading图
setLoadingImgPath: "",
//授权页背景图
setAuthBgImgPath: "",
setNavUi: {
bgColor:"#1190ff",
text: "一键登录",
textColor: "#fbfbfb",
textSize: "17",
returnImgHidden: "false",
returnImgPath: "static/close_black.png",
returnImgWidth: "",
returnImgHeight: "",
},
setWebNavUi: {
bgColor:"",//协议页面导航栏背景色
textColor: "",//协议页面导航栏Title字体颜色
textSize: "",//协议页面导航栏Title字体大小(单位:sp)
returnImgPath: ""//协议页面导航栏返回按钮图标地址,必须是assets目录中的
},
setLogoUi: {
imgPath: "static/mytel_app_launcher.png",
width: "",
height: "",
offsetY: logoOffsetY,
offsetY_B: "",
},
setSloganUi: {
text: "xxxx",
textColor: "#000000",
textSize: "20",
offsetY: sloganOffsetY,
offsetY_B: "",
},
setNumberUi: {
textColor: "#000000",
textSize: "30",
offsetY: "",
offsetY_B: "",
offsetX: "",
//3 左对齐
//5 右对齐
//默认居中
layoutGravity: "",
},
setLoginBtnUi: {
text: "",
textColor: "",
textSize: "",
imgPath: "",
offsetX: "",
offsetY: "",
offsetY_B: "",
width: "",
height: "",
marginLeftAndRight: "",
layoutGravity: "",
toastHidden: "false",
},
setSwitchUi: {
text: "",
textColor: "",
textSize: "20",
offsetY: "",
offsetY_B: "",
},
setCheckBoxUi: {
defaultChecked: "true",
width: "",
height: "",
//checkBox未勾选图片
unCheckedImgPath: "",
//checkBox已勾选图片
checkedImgPath: "",
},
setAppPrivacyOne: {
title: "用户协议",
url: "www.example.com",
},
setAppPrivacyTwo: {
title: "隐私政策",
url: "www.example.com",
},
setAppPrivacyThree: {
title: "服务协议",
url: "www.example.com",
},
setPrivacyUi: {
beforeText: "",
endText: "",
baseColor: "",
protocolColor: "",
vendorPrivacyPrefix: "",
vendorPrivacySuffix: "",
offsetX: "",
offsetY: "",
offsetY_B: "",
textSize: "",
marginLeftAndRight: "",
gravity: "",
layoutGravity: ""
},
setDialogTheme: {
alpha: "",
width: "300",
height: "400",
offsetX: "0",
offsetY: "0",
isBottom: "false"
}
}, //授权页添加自定义控件元素
widgets: {
widget1: {
widgetId: "one",
type: "TextView",
left: "",
top: widgetOffsetY,
right: "",
bottom: "",
width: "",
height: "30",
textContent: "切换其他登录方式",
textSize: "15",
textColor: "#cc0000",
// 0位置是在导航栏下面的区域
// 1位置是在导航栏上
// 2位置是在号码栏水平线上
locate: "0"
},
widget2: {
widgetId: "two",
type: "ImageView",
left: "30",
top: widgetOffsetY,
right: "",
bottom: "",
width: "",
height: "30",
backgroundImgPath: "static/weixin.png",
locate: "1"
}
}
}
iOS配置项说明。调用示例:{
uiConfig: {
// UIInterfaceOrientationMaskPortrait: 2
// UIInterfaceOrientationMaskLandscapeLeft: 16
// UIInterfaceOrientationMaskLandscapeRight: 8
// UIInterfaceOrientationMaskPortraitUpsideDown: 4
supportedInterfaceOrientations: "2", //设置屏幕方向,默认为竖屏,其他方向请参考上面列举
autoHideLoginLoading: "false", //在获取登录Token成功后,是否自动隐藏loading动画,默认隐藏,如果设置为不隐藏,需要手动调用 aLiSDKModule.hideLoginLoading() 来隐藏loading动画
setNavHidden: "true", //是否隐藏导航栏,默认不隐藏
setLogoHidden: "true", //是否隐藏中间的Logo图片,默认不隐藏
setSloganHidden: "true", //是否隐藏slogan,默认不隐藏
setSwitchHidden: "true", //是否隐藏切换其他方式按钮,默认不隐藏
setCheckboxHidden: "true", //是否隐藏check box,默认不隐藏
presentDirection: "2", //授权页动画方向,0:从底部弹出,1:从右边弹出,2:从上面弹出,3:从左边弹出
animationDuration: "2.5", //授权页动画时间,设置为0则为关闭动画
prefersStatusBarHidden: "true", //是否隐藏状态栏,默认不隐藏
// UIStatusBarStyleDefault: 0
// UIStatusBarStyleLightContent: 1
// UIStatusBarStyleDarkContent: 3
preferredStatusBarStyle: "0", //状态栏样式,参考上面枚列举
//导航栏相关设置
setNavUi: {
bgColor: "#FF8247",
text: "一键登录^-^",
textColor: "#FFFFFF",
textSize: "17",
returnImgHidden: "true", //是否隐藏返回按钮,默认不隐藏
returnImgPath: "static/close_black.png", //自定义返回按钮图片
returnImgX: "15",
returnImgY: "10",
returnImgWidth: "44",
returnImgHeight: "44"
},
//logo相关设置
setLogoUi: {
imgPath: "static/mytel_app_launcher.png",
x: "100",
y: "30",
width: "30",
height: "60"
},
//slogan相关设置
setSloganUi: {
text: "由阿里云通信提供服务",
textColor: "#FF8247", //必须在text不为空的情况下设置的该属性才会生效
textSize: "12", //必须在text不为空的情况下设置的该属性才会生效
x: "10",
y: "200",
width: "300",
height: "20"
},
//掩码相关设置
setNumberUi: {
textColor: "#FF8247",
textSize: "17",
x: "10",
y: "320"
},
//登录按钮相关设置
setLoginBtnUi: {
text: "一键登录^-^",
textColor: "#551A8B",
textSize: "15",
activeImgPath: "static/loginBtn_active.png", //check box勾选时按钮的颜色,注:只有activeImgPath、invalidImgPath、hightedImgPath全都设置,并且有效情况下才会生效
invalidImgPath: "static/loginBtn_invalid.png", //check box未勾选时按钮的颜色,注:只有activeImgPath、invalidImgPath、hightedImgPath全都设置,并且有效情况下才会生效
hightedImgPath: "static/loginBtn_highted.png", //check box勾选时,按压按钮时的颜色,注:只有activeImgPath、invalidImgPath、hightedImgPath全都设置,并且有效情况下才会生效
x: "10",
y: "350",
width: "300", //宽度必须大于屏幕的一半
height: "30" //高度不能小于20
},
//切换其他登录按钮相关设置
setSwitchUi: {
text: "切换其他登录方式^-^",
textColor: "#551A8B",
textSize: "12",
x: "10",
y: "420",
width: "300",
height: "20"
},
//check box相关设置
setCheckBoxUi: {
defaultChecked: "true", //check box默认是否勾选
unCheckedImgPath: "static/checkbox0", //必须同时设置checkedImgPath有效,该属性才会生效
checkedImgPath: "static/checkbox1", //必须同时设置unCheckedImgPath有效,该属性才会生效
width: "30" //默认宽度为17 pt
},
//授权页底部自加协议
setAppPrivacyOne: {
title: "《协议1》",
url: "www.example.com"
},
//只有设置了setAppPrivacyOne生效,setAppPrivacyTwo才会生效
setAppPrivacyTwo: {
title: "《协议2》",
url: "www.example.com"
},
//只有设置了setAppPrivacyOne、setAppPrivacyTwo生效,setAppPrivacyTwo才会生效
setAppPrivacyThree: {
title: "《协议3》",
url: "www.example.com"
},
//设置协议相关
setPrivacyUi: {
beforeText: "协议整体前缀",
endText: "协议整体后缀",
baseColor: "#8B8878",
protocolColor: "#FFB5C5",
textSize: "13", //协议文字大小,小于12不生效
vendorPrivacyPrefix: "《", //供应商协议前缀
vendorPrivacySuffix: "》", //供应商协议后缀
alignment: "1", //协议文字对齐方式,0:左对齐,1:中间对齐,2:右对齐
x: "20",
y: "800",
width: "200" //宽度小于check box的宽度时不生效(该宽度为check box宽度 + 协议文本宽度),高度SDK内部自适应,外面设置无效
},
//设置协议详情页导航栏相关
setWebNavUi: {
bgColor: "#CD1076",
textColor: "#EECFA1",
textSize: "30",
returnImgPath: "/static/close_black.png"
},
//设置弹窗样式相关
setDialogTheme: {
alpha: "0.2", //弹框背部蒙层透明度
radius: ["10", "10", "10", "10"], //设置弹窗四个角的弧度
x: "10",
y: "160",
width: "300",
height: "650"
}
},
//自定义控件
widgets: [{
widgetId: "widgetId-001", //控件id
type: "ImageView", //控件类型,ImageView(图片)
imgPath: "static/qq.png",
x: "10",
y: "60",
width: "100",
height: "100",
// UIViewContentModeScaleToFill: 0
// UIViewContentModeScaleAspectFit: 1
// UIViewContentModeScaleAspectFill: 2
// UIViewContentModeRedraw: 3
// UIViewContentModeCenter: 4
// UIViewContentModeTop: 5
// UIViewContentModeBottom: 6
// UIViewContentModeLeft: 7
// UIViewContentModeRight: 8
// UIViewContentModeTopLeft: 9
// UIViewContentModeTopRight: 10
// UIViewContentModeBottomLeft: 11
// UIViewContentModeBottomRight: 12
contentMode: "1", //内容填充方式,参考上面列举
backgroundColor: "#EE6A50",
masksToBounds: "true",
cornerRadius: "5",
borderColor: "#8B7D6B",
borderWidth: "1.0"
},
{
widgetId: "widgetId-002",
type: "Button", //Button(按钮)
backgroundImage: "static/qq.png",
// UIControlContentVerticalAlignmentCenter: 0
// UIControlContentVerticalAlignmentTop: 1
// UIControlContentVerticalAlignmentBottom: 2
// UIControlContentVerticalAlignmentFill: 3
verticalAlignment: "0", //标题竖直对齐方式,参考上面列举
// UIControlContentHorizontalAlignmentCenter: 0
// UIControlContentHorizontalAlignmentLeft: 1
// UIControlContentHorizontalAlignmentRight: 2
// UIControlContentHorizontalAlignmentFill: 3
// UIControlContentHorizontalAlignmentLeading API_AVAILABLE(ios(11.0), tvos(11.0)): 4
// UIControlContentHorizontalAlignmentTrailing API_AVAILABLE(ios(11.0), tvos(11.0)): 5
horizontalAlignment: "0", //标题水平对齐方式,参考上面列举
textContent: "这是一个按钮",
textSize: "13",
textColor: "#FFFFFF",
numberOfLines: "0",
x: "10",
y: "200",
width: "100",
height: "100",
backgroundColor: "#EE6A50",
masksToBounds: "true",
cornerRadius: "5",
borderColor: "#8B7D6B",
borderWidth: "1.0"
},
{
widgetId: "widgetId-003",
type: "Label", //Label(文本)
// NSTextAlignmentLeft: 0
// NSTextAlignmentCenter: 1
// NSTextAlignmentRight: 2
alignment: "1", //文字对齐方式,参考上面枚举
textContent: "这是一串文本信息xxxx这是一串文本信息xxxx这是一串文本信息xxxx",
textSize: "13",
textColor: "#FFFFFF",
numberOfLines: "0",
x: "10",
y: "450",
width: "100",
height: "100",
backgroundColor: "#EE6A50",
masksToBounds: "true",
cornerRadius: "5",
borderColor: "#8B7D6B",
borderWidth: "1.0"
}
]
}