XUITab()

new XUITab()

Methods

AddIcon(strIcon, nSize, bRadius)

加入icon
Parameters:
Name Type Description
strIcon String icon
nSize Number icon大小
bRadius Number true圆角false无圆角

AddIconByIndex(nIndex, strIcon, nSize, bRadius)

指定位置加入icon
Parameters:
Name Type Description
nIndex Number 索引
strIcon String icon
nSize Number icon大小
bRadius Number true圆角false无圆角

AppendItem(strText, strIcon, nSize, bRadius)

添加item项
Parameters:
Name Type Description
strText String item项文本
strIcon String icon背景
nSize Number icon大小
bRadius Boolean icon圆角

ChangeItemTextByIndex(nIndex, strText)

修改item项文本
Parameters:
Name Type Description
nIndex Number 索引
strText String item项文本

GetSelectedItemIndex() → {Number}

获取选中项索引
Returns:
Number

GetSelectedItemText() → {String}

获取选中项文本
Returns:
String

InsertItem(nIndex, strText, strIcon, nSize, bRadius)

插入item项
Parameters:
Name Type Description
nIndex Number 索引
strText String item项文本
strIcon String icon背景
nSize Number icon大小
bRadius Boolean icon圆角

IsBgDrawColor() → {Boolean}

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

IsItemDrawColor() → {Boolean}

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

RemoveAllItems()

删除所有item项

RemoveItemByIndex(nIndex)

根据Index删除item项
Parameters:
Name Type Description
nIndex Number 索引

SetBgColor(strColor)

背景颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
BgColor Color "0xffffffff"

SetBgDrawColor(bDrawColor)

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

SetBgImg(strPath)

背景图片
Parameters:
Name Type Description
strPath ImageProp 图片路径
Properties:
Name Type Description
BgImg ImageProp ""

SetBorderColor(strColor)

背景边框颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
BorderColor Color "0xff000000"

SetBorderSize(nSize)

背景边框宽度
Parameters:
Name Type Description
nSize Number 边框宽度
Properties:
Name Type Description
BorderSize Number 1

SetFontSize(nSize)

文本大小
Parameters:
Name Type Description
nSize Number
Properties:
Name Type Description
FontSize Number 12

SetIconBg(nIndex, strBg)

icon背景
Parameters:
Name Type Description
nIndex Number 索引
strBg String 背景

SetIconHorizontalPosition(nPos)

icon水平位置
Parameters:
Name Type Description
nPos Number 水平位置
Properties:
Name Type Description
IconHorizontalPosition Number 0

SetIconVerticalPosition(nPos)

icon垂直位置
Parameters:
Name Type Description
nPos Number 垂直位置
Properties:
Name Type Description
IconVerticalPosition Number 50

SetItemAutoLayout(bAuto)

item项自适应布局
Parameters:
Name Type Description
bAuto Boolean 颜色
Properties:
Name Type Description
ItemAutoLayout Boolean true

SetItemDrawColor(bDrawColor)

item背景是否颜色绘制
Parameters:
Name Type Description
bDrawColor Boolean
Properties:
Name Type Description
ItemDrawColor Boolean true

SetItemGap(nGap)

item间隔
Parameters:
Name Type Description
nGap Number
Properties:
Name Type Description
ItemGap Number 0

SetItemHeight(nHeight)

item高度
Parameters:
Name Type Description
nHeight Number 边框高度
Properties:
Name Type Description
ItemHeight Number 30

SetItemHotColor(strColor)

item项高亮颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
ItemHotColor Color "0xff595a5d"

SetItemHotImg(strPath)

item项高亮图片
Parameters:
Name Type Description
strPath ImageProp 图片地址
Properties:
Name Type Description
ItemHotImg ImageProp ""

SetItemHotTextFontColor(strColor)

item项高亮文本颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
ItemHotTextFontColor Color "0xffffffff"

SetItemNorColor(strColor)

item项正常颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
ItemNorColor Color "0xff4c4c4f"

SetItemNorImg(strPath)

item项正常图片
Parameters:
Name Type Description
strPath ImageProp 图片地址
Properties:
Name Type Description
ItemNorImg ImageProp ""

SetItemNorTextFontColor(strColor)

item项正常文本颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
ItemNorTextFontColor Color "0xffffffff"

SetItemSelectedColor(strColor)

item项选中颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
ItemSelectedColor Color "0xff3c3c3c"

SetItemSelectedImg(strPath)

item项选中图片
Parameters:
Name Type Description
strPath ImageProp 图片地址
Properties:
Name Type Description
ItemSelectedImg ImageProp ""

SetItemSelectTextFontColor(strColor)

item项选中文本颜色
Parameters:
Name Type Description
strColor String 颜色
Properties:
Name Type Description
ItemSelectTextFontColor Color "0xffffffff"

SetItemWidth(nWidth)

item宽度
Parameters:
Name Type Description
nWidth Number 宽度
Properties:
Name Type Description
ItemWidth Number 90

SetSelectedItemByIndex(nIndex)

当前选中索引
Parameters:
Name Type Description
nIndex Number 索引

SetSelectedItemByText(strText)

当前选中文本
Parameters:
Name Type Description
strText String item项文本

SetTextHorAlign(strAlign)

文本水平布局
Parameters:
Name Type Description
strAlign String 水平对齐
Properties:
Name Type Description
TextHorAlign Combo ["left","center","right"]

SetTextHorizontalPosition(nPos)

文本水平位置
Parameters:
Name Type Description
nPos Number 水平位置
Properties:
Name Type Description
TextHorizontalPosition Number 0

SetTextVerAlign(strAlign)

文本竖直布局
Parameters:
Name Type Description
strAlign String
Properties:
Name Type Description
TextVerAlign Combo ["top","middle","bottom"]

SetTextVerticalPosition(nPos)

文本垂直位置
Parameters:
Name Type Description
nPos Number 垂直位置
Properties:
Name Type Description
TextVerticalPosition Number 0

SetVerticalLayoutMode(bVertical)

垂直布局
Parameters:
Name Type Description
bVertical Boolean 颜色
Properties:
Name Type Description
LayoutMode Boolean false