Thursday, November 5, 2020

How to remove auto focus from EditText in Android

Tags: How to remove auto focus from EditText in Android,to remove auto focus from EditText in Android, EditText Android Example,Code Android Example, EditText Android code.

activity_main.xml

<RelativeLayout

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

    xmlns:tools="http://schemas.android.com/tools"

    android:id="@+id/rl"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:padding="10dp"

    tools:context=".MainActivity"

    android:background="#d4c5b8"

    android:focusable="true"

    android:focusableInTouchMode="true"

    >

    <EditText

        android:id="@+id/et"

        android:layout_width="250dp"

        android:layout_height="wrap_content"

        android:hint="Input your country"

        android:padding="10dp"

        />

    <EditText

        android:id="@+id/et_city"

        android:layout_width="250dp"

        android:layout_height="wrap_content"

        android:hint="Input your City"

        android:padding="10dp"

        android:layout_below="@+id/et"

        />

</RelativeLayout>

No comments:

Post a Comment