TItanium appcelerator:如何以编程方式创建形状

时间:2014-03-13 07:28:04

标签: mobile titanium appcelerator

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

enter image description here

2 个答案:

答案 0 :(得分: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();

答案 1 :(得分:0)

此图片显示了在holo主题中显示在android textfield下的行。您可能想看看这个问题How to use Holo.Light theme, and fall back to 'Light' on pre-honeycomb devices?

相关问题