How do I draw a line in Titanium?

喜欢而已 提交于 2019-12-22 09:01:00

问题


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


回答1:


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




回答2:


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:


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',
}


来源:https://stackoverflow.com/questions/3981206/how-do-i-draw-a-line-in-titanium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!