本机脚本中的多行文本框 [英] Multiline textbox in nativescript

查看:73
本文介绍了本机脚本中的多行文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do I get a text area in native script that supports multiline?

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

I have tried using the text field which does not have the support for multiline.

还尝试过以下代码向文本字段添加多行:

Have also tried this code to add multiline to the text field:

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

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

推荐答案

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

After a bit of research was able to make this text box using the "TextVIew" component of the native script and some of its properties.

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

Here is the code for the text box: <TextView style="margin-top: 15px" borderColor="#DEDEDE" borderWidth="1" height="100px" hint="Enter Note" returnKeyType="send" class="input input-border"></TextView>

以下是文本视图工作的屏幕截图:

Here is the screen shot of the text view working:

这篇关于本机脚本中的多行文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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