Tip: 参考文档:http://blog.csdn.net/reylen/article/details/21012859 @property(nonatomic) NSLineBreakMode lineBreakMode; // default is NSLineBreakByTruncatingTail. used for single and multiple lines of text lineBreakMode:设置标签文字过长时的显示方式. // NSParagraphStyle
var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.font="30px Arial"; var txt="Hello World" ctx.fillText("width:" + ctx.measureText(txt).width,10,50) ctx.fillText(txt,10,100); 用法 me