Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create multiline TextBox in Xamarin.Forms

Tags:

How to create multiline TextBox in Xamarin.Forms?

With some research I found that it can be done with <Editor> tag in XAML page with custom font size and style but that creates center aligned text. However I want to start cursor and text from top left.

like image 557
Nirav Mehta Avatar asked Nov 17 '14 05:11

Nirav Mehta


People also ask

What is multiline textbox?

A multiline text box control is a large text box that can display several lines of text or accept this text from user input. Text boxes are often linked to select value lookups and detailed menus. You can place a multiline text box control within a section control.

Which property allows multiple line input in textbox?

A multiline text box allows you to display more than one line of text in the control. If the WordWrap property is set to true , text entered into the multiline text box is wrapped to the next line in the control.


1 Answers

The Editor is used for collecting text that is expected to take more than one line. Example:

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
x:Class="TextSample.EditorPage"
Title="Editor">
    <ContentPage.Content>
        <StackLayout>
            <Editor Text="Editor is used for collecting text that is expected to take more than one line." BackgroundColor="#2c3e50" HeightRequest="100" />
        </StackLayout>
    </ContentPage.Content>
</ContentPage>
like image 124
Venu Gopal Tewari Avatar answered Sep 28 '22 01:09

Venu Gopal Tewari