give a square style to the Android textview

1

Dear, I have to give you a style similar to this mockup

But the text view that I have are these

            <TextView
            android:hint="@string/Reference"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:textColor="@color/letter_grey"
            android:textColorHint="@color/letter_color_light"
            android:textSize="@dimen/simple_text_size" />
        <EditText
            android:id="@+id/reference"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:paddingTop="10dp"
            android:textSize="@dimen/simple_text_size"
            android:textColor="@color/light_grey"/>

I would like to know if someone tells me how to leave them squared because they do not fit like that, they are currently like this

    
asked by Bruno Sosa Fast Tag 11.08.2017 в 15:12
source

1 answer

3

You can achieve this by creating a drawable with the shape tag. Create a file in the drawable folder and call it edit_text_border.xml :

<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <solid android:color="#fff">

    </solid>
    <stroke
        android:width="1dp"
        android:color="#888" />
</shape>

And in your EditText:

<EditText
            android:id="@+id/reference"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:paddingTop="10dp"
            android:background="@drawable/edit_text_border"
            android:textSize="@dimen/simple_text_size"
            android:textColor="@color/light_grey"/>
    
answered by 11.08.2017 / 15:49
source