nativescript中的多行文本框

时间:2017-03-25 06:15:17

标签: angular nativescript

如何在本机脚本中获得支持多行的文本区域?

我尝试使用不支持多行的文本字段。

还尝试使用此代码将多行添加到文本字段:

var myTextfield = this.page.getViewById<TextField>("noteView");

myTextfield.android.setInputType(android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE);  

1 个答案:

答案 0 :(得分:9)

经过一些研究后,能够使用本机脚本的“TextVIew”组件及其一些属性来创建此文本框。

以下是文本框的代码: <TextView style="margin-top: 15px" borderColor="#DEDEDE" borderWidth="1" height="100px" hint="Enter Note" returnKeyType="send" class="input input-border"></TextView>

以下是文字视图的屏幕截图:

Screen Shot of the textview working