简体   繁体   English

要获取光标在textInput中的位置

[英]Want to get cursor position within textInput

I am using textInput within grid using rendrer. 我正在使用rendrer在网格内使用textInput。 I am populating a suggestion box just below the text input field on the basis of typed character and index of text input.Problem is that if i shrink grid column then suggestion box is not populating at the right place so I want global position of cursor in the text input field . 我根据键入的字符和文本输入的索引在文本输入字段的下方填充一个建议​​框。问题是如果我缩小网格列,则建议框未填充在正确的位置,因此我希望光标位于全局位置文本输入字段。

Something like that: 像这样:

var inputTxt : TextInput = new TextInput;

var x : Number = inputTxt.cursorManager.currentCursorXOffset;

var y : Number = inputTxt.cursorManager.currentCursorYOffset;

Try using 'global coordinate'. 尝试使用“全局坐标”。 This might resolve your problem. 这可能会解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM