XUISwitch()

new XUISwitch()

Methods

GetCircleBtnImg() → {String}

获取圆按钮图片
Returns:
String

GetCtrlBgColor() → {String}

获取背景颜色
Returns:
String

GetCtrlBgImage() → {String}

获取背景图片
Returns:
String

GetSwitchBorderColor() → {String}

获取轮廓颜色
Returns:
String

GetSwitchBorderStateColor() → {Array}

获取开关边框颜色
Returns:
Array

GetSwitchBtnColor() → {String}

获取圆钮颜色
Returns:
String

GetSwitchBtnONorOff() → {Boolean}

获取开关状态
Returns:
Boolean

GetSwitchBtnTextColor() → {String}

获取文本颜色
Returns:
String

GetSwitchBtnTextFontSize() → {Number}

获取文本大小
Returns:
Number

GetTextLeftOrRight() → {Boolean}

获取文本位置
Returns:
Boolean

IsDrawColor() → {Boolean}

背景是否以颜色绘制
Returns:
Boolean

SetBtnAndTextColor(strColorOn, strColorOff, strTxtOn, strTxtOff)

开关颜色
Parameters:
Name Type Description
strColorOn String 圆钮开状态颜色
strColorOff String 圆钮关状态颜色
strTxtOn String 开文本颜色
strTxtOff String 关文本颜色
Properties:
Name Type Description
BtnAndTextColor Collection ["0xff44bfff","0xff808080","0xffffffff","0xff808080"]

SetCircleBtnImg(strPathOff, strPathOn, strOnColor, strOffColor)

圆按钮图片
Parameters:
Name Type Description
strPathOff ImageProp 关状态图片
strPathOn ImageProp 开状态图片
strOnColor String 开文本颜色
strOffColor String 关文本颜色
Properties:
Name Type Description
CircleBtnImg Collection ["","","0xffffffff","0xff808080"]

SetCtrlBgColor(strColor)

背景颜色
Parameters:
Name Type Description
strColor String 背景颜色
Properties:
Name Type Description
CtrlBgColor Color "0xff003440"

SetCtrlBgImage(strBgImg)

背景图片
Parameters:
Name Type Description
strBgImg ImageProp 背景图片
Properties:
Name Type Description
CtrlBgImage ImageProp "XUISwitch/images/bg1.jpg"

SetDrawColor(bDrawColor)

背景颜色绘制
Parameters:
Name Type Description
bDrawColor Boolean
Properties:
Name Type Description
BgDrawColor Boolean true

SetSwitchBorderColor(strColor)

开关轮廓颜色
Parameters:
Name Type Description
strColor String 开关轮廓颜色
Properties:
Name Type Description
SwitchBorderColor Color "0xff2a81d1"

SetSwitchBorderStateColor(strColorO, strColorC)

开关边框颜色
Parameters:
Name Type Description
strColorO String 开时颜色
strColorC String 关时颜色
Properties:
Name Type Description
SwitchBorderStateColor Collection ["0xff2a81d1","0xff17355D"]

SetSwitchBtnONorOff(bSwitch)

开关状态
Parameters:
Name Type Description
bSwitch Boolean false是关true是开
Properties:
Name Type Description
SwitchBtnONorOff Boolean false

SetSwitchBtnTextFontSize(nvalue)

按钮文本大小
Parameters:
Name Type Description
nvalue Number 按钮文本大小
Properties:
Name Type Description
SwitchBtnTextFontSize Number 14

SetTextLeftOrRight(bPos)

文本居左/右
Parameters:
Name Type Description
bPos Boolean 0左1右
Properties:
Name Type Description
TextLeftOrRight Boolean true

SwitchButton(strBgColorOn, strBgColorOff, strTxtColorON, strTxtColorOff)

开关
Parameters:
Name Type Description
strBgColorOn String 开状态圆钮颜色
strBgColorOff String 关状态圆钮颜色
strTxtColorON String 开文本颜色
strTxtColorOff String 关文本颜色