Show "activity" with a Edittext multiline

1

I do not really know how to explain what I need, so I'll use an image to make me understand what I'm looking for is the following. Pressing a button shows the following appearing from bottom to top.

What I have is the following in the XML but it shows it as Dialog

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_enviar_tipo_dialogo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.hp14.iteracion2.Asistente.EnviarTipoDialogo"
tools:showIn="@layout/activity_enviar_tipo_dialogo">
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">

    <TextView
        android:text="Envía tu inquietud, realizando una pregunta acorde del tema. "
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginLeft="25dp"
        android:layout_marginStart="25dp"
        android:id="@+id/textView" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPersonName"
        android:ems="10"
        android:id="@+id/txtenviar"
        android:maxLines="2"
        android:hint="Escribir..."
        android:layout_centerVertical="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <Button
        style="?android:attr/buttonStyleSmall"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Enviar"
        android:id="@+id/btnenviar"
        android:background="@drawable/boton2"
        android:layout_below="@+id/txtenviar"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

</RelativeLayout>

Any ideas to perform this task?

    
asked by Ashley G. 15.01.2017 в 01:11
source

1 answer

0

If you want to have a EditText multilineas, you must make use of the property:

android:inputType="textMultiLine" 

You can define the number of lines to be displayed by default:

android:lines="5" 

as well as a minimum and maximum:

 android:minLines="2" 
 android:maxLines="10"

It is recommended to enable vertical scroll bars:

  android:scrollbars="vertical" 

This is an example:

<EditText
    android:id="@+id/myedittext"
    android:layout_height="wrap_content" 
    android:layout_width="match_parent"
    android:inputType="textMultiLine" 
    android:lines="5" 
    android:minLines="2"
    android:maxLines="10"
    android:scrollbars="vertical"/>
    
answered by 16.01.2017 в 21:27