How do I draw a line in Titanium?

2019-05-07 08:19发布

How Do I draw a line in Titanium that works in both Android and iPhone?

3条回答
劫难
2楼-- · 2019-05-07 08:34

To create a line, I use;

var view = Ti.UI.createView({
    height:180,
    width:300
});

var line = Ti.UI.createView({
    height:2,
    bottom:0,
    left:0,
    right:0,
    borderWidth:1,
    borderColor:'#aaa'
 });

view.add(line);
查看更多
仙女界的扛把子
3楼-- · 2019-05-07 08:36

Add this to your view.xml

<View class="line"></View>

Add this to your style.tss

".line": {
    height: '2dp',
    bottom: '2dp',
    left: '0dp',
    right: '0dp',
    borderWidth: '1',
    borderColor:'#aaa',
}
查看更多
Animai°情兽
4楼-- · 2019-05-07 08:53

you could create webview and use the <canvas> tag to draw in the web view

查看更多
登录 后发表回答