38532

Multiline textbox in nativescript

Question:

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

Answer1:

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:

<a href="https://i.stack.imgur.com/ch2bM.png" rel="nofollow"><img alt="Screen Shot of the textview working" class="b-lazy" data-src="https://i.stack.imgur.com/ch2bM.png" data-original="https://i.stack.imgur.com/ch2bM.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>

Recommend

  • Call Unix external commands with arguments
  • xUnit with Jenkins: how to display colors in the Build Console Output?
  • ExternalInterface gives me an option of stopping the script when using multiple parameters. Why?
  • Is there a standard client behaviour for submitting an empty select multiple?
  • What is the difference between postgres and postgresql_psycopg2 as a database engine for django?
  • Load the Drop down list dynamically using jstl [duplicate]
  • Cordova File Plugin to load video source from ios cache
  • How to disable caching with HttpClient get in Angular 6
  • Verify beacon(https request) on the page using a protractor test
  • How to split array dynamically based on single value in JavaScript Node.js
  • Target Framework change 4.0 to 3.5 breaks EF model. Error 111: Referential constraint errors
  • Are random seeds compatible between systems?
  • Unable to Get records from Table Storage
  • GridLayout and number of rows and columns
  • STEP macro does not work in Clozure CL
  • Select * sql query vs Select specific columns sql query [duplicate]
  • C# How to add my program to context menu?
  • Manifest merger failed: Attribute application@appComponentFactory
  • Jitpack: Failed to install the following Android SDK packages as some licences have not been accepte
  • AWS CLI S3API find newest folder in path
  • Google Apps Script Async function execution on Server side
  • Installing apk on android device via ADB with Java program on Linux
  • MySQL ordering a date range to the beginning, then ordering everything else by other criteria
  • Failed to resolve: firebase-auth-15.0.0 [closed]
  • python selenium scraping tbody
  • How to redirect into different page by user type in php and mysql
  • Thumbnails for mxml components in Flex
  • How do I use libcurl to printf a remote FTP directory listing?
  • JQuery: Infinite input select
  • How to warp text around image in iOS?
  • Update cell query for Excel ADO from Delphi
  • How to get rgb from transparent pixel in js
  • Cross compile glibc for arm, got undefined reference to some unwind functions
  • How to use FirstOrDefault inside Include
  • PHP Permalinks.. how to change?
  • media foundation H264 decoder not working properly
  • Running R's aov() mixed effects model from Python using rpy2
  • Access to a Matlab gui from the web
  • ReferenceError: TextEncoder is not defined