【问题标题】:TItanium appcelerator : How to create the shape programaticallyTItanium appcelerator:如何以编程方式创建形状
【发布时间】:2014-03-13 07:28:04
【问题描述】:

有什么方法可以使用 Titanium appcelerator 中的文本框边框创建下面的图像?我不想使用图像。请帮忙 。

【问题讨论】:

    标签: mobile titanium appcelerator


    【解决方案1】:

    观看次数如何?根据需要更改形状的位置和宽度。高效的? /耸肩

    var win = Ti.UI.createWindow({
        backgroundColor: 'white'
    });
    // no background color
    var shape = Ti.UI.createView({
        height: '300dp',
        width: '200dp'
    });
    
    var color = "blue";
    
    var bottom = Ti.UI.createView({
        height: '1',
        left: 0,
        right: 0,
        bottom: 0,
        backgroundColor: color
    });
    
    var left = Ti.UI.createView({
        width: '1',
        height: '10',
        left: 0,
        bottom: 0,
        backgroundColor: color
    });
    
    var right = Ti.UI.createView({
        width: '1',
        height: '10',
        right: 0,
        bottom: 0,
        backgroundColor: color
    });
    
    shape.add(bottom);
    shape.add(left);
    shape.add(right);
    
    win.add(shape);
    
    win.open();
    

    【讨论】:

      【解决方案2】:

      此图像显示了将出现在全息主题中的 android 文本字段下的行。你可能想看看这个问题How to use Holo.Light theme, and fall back to 'Light' on pre-honeycomb devices?

      【讨论】:

        猜你喜欢
        • 2015-04-19
        • 2023-03-24
        • 1970-01-01
        • 2011-09-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-03-10
        • 2013-11-15
        相关资源
        最近更新 更多