在画布上的精确位置创建输入TextField? [英] Creating Input TextField at precise position on Canvas?

查看:107
本文介绍了在画布上的精确位置创建输入TextField?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

画布可以绘制文本,但不能创建输入文本字段。这将意味着一个人必须在html,但是你怎么能确定的位置的文本字段准确地在你想要什么?

Canvas can draw text but it cannot create input textfield. This would mean one have to do it in html but then how can you be sure to position that textfield exactly where you want ?

我想要能够以编程方式

推荐答案

创建以下Html结构以将输入框放置在画布上。

Create following Html structure to place inputbox on canvas.

<div id="container" style="width:500px; height:500px; position:relative;" >
    <canvas id="drawing-surface" width="500px" height="500px"></canvas>
    <input type="text" style="position:absolute; left=?; top=?;"></input>
</div>

希望这解决了您的问题。替换left =?和top =?具有适当的位置。

Hope this solves your problem. Replace left=? and top=? with appropriate positions.

这篇关于在画布上的精确位置创建输入TextField?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆