Multiline textbox in nativescript

怎甘沉沦 提交于 2019-12-10 16:20:55

问题


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);  

回答1:


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.

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:



来源:https://stackoverflow.com/questions/43013206/multiline-textbox-in-nativescript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!