I want to apply the border to TextInputLayout
as shown in the picture.
I have implemented this right now.
but I want, as shown in the figure (i.e. the label fits in the frame).
The code that was implemented for EditText
is below.
<customviews.MyEditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edittext_border_background"
android:layout_marginEnd="30dp"
android:layout_marginStart="30dp"
android:layout_marginTop="45dp"
android:gravity="start"
android:hint="@string/hint_username"
android:imeOptions="actionNext|actionDone"
android:inputType="textEmailAddress|text"
android:padding="10dp"
android:textColor="@color/primary_text"
android:textColorHint="@color/secondary_text"
android:textSize="16sp"
/>
and for the border I applied background editing editetext_border_background.xml as follows
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="20dp">
<solid android:color="#FFFFFF"/>
<corners
android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp"/>
<stroke
android:width="1dip"
android:color="@color/primary" />
</shape>
when I tried to apply the border to TextInputLayout
, it does not give the expected result.
Can someone help me?
source
share