开发者

How do I draw a line in Titanium?

开发者 https://www.devze.com 2023-01-21 09:25 出处:网络
How Do I draw a line in Titanium that works in both开发者_Python百科 Android and iPhone?To create a line, I use;

How Do I draw a line in Titanium that works in both开发者_Python百科 Android and iPhone?


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);


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消