【问题标题】:Nativescript canvasNativescript 画布
【发布时间】:2016-08-01 14:32:57
【问题描述】:

谁能告诉我如何在 nativescript 中创建画布?我想要这样的东西

var canvas = new fabric.Canvas('sheet');
canvas.isDrawingMode = true;
canvas.freeDrawingBrush.width = 30;
canvas.freeDrawingBrush.color = "#000000";
#sheet {
    border:1px solid blue;
}
<canvas id="sheet" width="400" height="400"></canvas>

http://jsfiddle.net/B525t/52/ 找到,适用于 android 和 ois。

谢谢

【问题讨论】:

标签: javascript xml nativescript


【解决方案1】:

请参阅 https://github.com/NativeScript/nativescript-canvas,这是用于 NativeScript 应用程序的 <canvas> 元素的概念验证实现。在test 文件夹中查看正在使用的实现的一个小例子。如果您对该组件有任何反馈,请尝试repo’s issues tab

【讨论】:

  • 谢谢 TJ,但是当我使用命令提示符在测试文件中运行 android 包时,我不断收到以下错误:“无法安装依赖项。确保您的 package.json 有效并且所有依赖项都是正确的。错误是:nativescript-canvas@0.0.1 prepublish:node prepackage.js Exit status 1。”你能帮我解决吗?我试过没有成功。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多