控件:Line 分割线

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

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

返回值:无

参数 类型 必填 说明 默认值
type string 控件类型:Line -
color string 线条颜色 ,默认灰色,使用 RGB 十进制数值,以英文半角逗号分割 "208,208,208"
align string 对齐方式,默认左对齐。
可取值为:左对齐 left,右对齐 right,居中 center
"left"
valign string 垂直对齐方式,顶端对齐 top,
垂直居中 center,底部对齐 bottom,
默认垂直居中,仅支持 Androidv3.2.0、iOSv3.1.5 以及以上版本
"center"
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 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""