控件:Line 分割线

引擎版本:仅支持 Android v3.1.3, iOS v3.0.6 及其以上版本

一共有五种属性:控件类型 type、字体颜色 color、对齐方式 align、高度 height 、宽度 width

参数 类型 必填 说明 默认值
type string 控件类型:Line -
color string 线条颜色 ,默认灰色,使用 RGB 十进制数值,以英文半角逗号分割 "208,208,208"
align string 对齐方式,默认左对齐。
可取值为:左对齐 left,右对齐 right,居中 center
"left"
height number 线条高度,默认 0.5 像素,个位数像素显示差异很小,并不是参数不生效
Android 设备仅支持整数否则会提示 UI 格式错误
0.5
width number 线条宽度,默认全屏,
Android 设备仅支持整数否则会提示 UI 格式错误
屏幕宽度

函数示例

local ts = require("ts")
local cjson = ts.json
w,h = getScreenSize();
MyTable = {
    ["style"]  = "default",    
    ["width"] = w,          
    ["height"] = h,            
    ["cancelname"] = "取消",  
    ["okname"] = "开始", 
    ["title"] = "居中自定义字号",
    ["titlealign"] = "center",
    ["align"] = "center",
    ["titlesize"] = 12,  
    ["titles"] = "分割线,第二页", 
    ["pagetype"]= "multi",  
    ["selpage"] = 1,   
    ["orient"] = 0, 
    ["btnbkcolor"] = "255,255,255",         
    ["bgcolor"] = "255,255,255",
    ["pagenumtype"] = "tab", 
    ["config"] = "showuiTest1.txt",  
    ["timer"] = 99,  
    ["rettype"] = "table",   
    pages            =
    {
        {
            {   
                ["type"] = "Line",            
                ["color"] = "0,0,0",    
                ["align"] = "center",  
                ["valign"] = "top",  
                ["height"] = 1, 
                ["width"] = 600,           
            },
            { 
                ["type"] = "Line",                    
                ["color"] = "99,199,99",                    
                ["align"] = "center",  
                ["valign"] = "top",              
                ["height"] = 100, 
                ["width"] = 500,   
            },
            {
                ["type"] = "Line",                    
                ["color"] = "188,88,88",                    
                ["align"] = "center",  
                ["valign"] = "top",              
                ["height"] = 200, 
                ["width"] = 400,   
            },
            {
                ["type"] = "Line",                    
                ["color"] = "233,233,233",                    
                ["align"] = "center",  
                ["valign"] = "top",              
                ["height"] = 300, 
                ["width"] = 300,   
            },
        }
    }
}   
local MyJsonString = cjson.encode(MyTable);
UIret,values = showUI(MyJsonString)
Copyright 北京帮你玩科技有限公司 2020 all right reserved,powered by Gitbook该文章修订时间: 2020-09-08 20:52:48

results matching ""

    No results matching ""