相关疑难解决方法(0)

如何在页面加载时从TextInputLayout中删除焦点?

当这个xml加载到片段中时,焦点直接转到第二个编辑文本,我希望编辑文本应该专注于触摸它.我想用我自己的颜色提示和在其上打字的文字.任何帮助高度赞赏.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="23dp">

    <TextView
        android:id="@+id/basic_details_heading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/basic_details"
        android:textSize="16sp"
        android:paddingLeft="0dp"
        android:textColor="@color/basic_details_gray"
        android:textStyle="normal"
        android:typeface="monospace"
        android:includeFontPadding="false"
        android:layout_alignParentLeft="true"
        />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/container_first"
        android:layout_below="@+id/basic_details_heading"
        android:paddingLeft="0dp"
        >

      <!--  <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/profile_created_for"
            android:id="@+id/sub_head_one"
            android:textStyle="normal"
            android:textColor="@color/login_background"
            android:textSize="12sp"
            android:paddingLeft="0dp"
            android:paddingTop="0dp"
            android:visibility="gone"
            android:includeFontPadding="false"
            android:layout_alignParentLeft="true"
            />-->
        <android.support.design.widget.TextInputLayout
            android:id="@+id/profile_created_for"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            >

            <EditText
                android:id="@+id/edit_text_profile_created_for"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="-4dp"
                android:textSize="15sp"
                android:textColor="@color/black"
                android:textStyle="normal"
                android:hint="Profile Created For"
                android:focusable="false"/>

        </android.support.design.widget.TextInputLayout>

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/nav_next"
            android:layout_alignParentRight="true"
            android:paddingTop="20dp"
            android:id="@+id/profile_created_for_arrow"
            />


        <android.support.design.widget.TextInputLayout
            android:id="@+id/name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/profile_created_for"
            android:focusableInTouchMode="true"
            >

            <EditText
                android:id="@+id/edit_text_name"
                android:layout_width="match_parent" …
Run Code Online (Sandbox Code Playgroud)

android

4
推荐指数
3
解决办法
6643
查看次数

标签 统计

android ×1