Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio编辑文本可点击_Android_Android Edittext - Fatal编程技术网

Android studio编辑文本可点击

Android studio编辑文本可点击,android,android-edittext,Android,Android Edittext,我有一个简单的问题。我正在创建一个游戏,玩家必须在EditText中设置他们的昵称。当我开始一项他们必须输入姓名的活动时,键盘会弹出,如下所示: 这是我的编辑文本: <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Enter Nickname" android:textColorHint="@android:co

我有一个简单的问题。我正在创建一个游戏,玩家必须在EditText中设置他们的昵称。当我开始一项他们必须输入姓名的活动时,键盘会弹出,如下所示:

这是我的编辑文本:

 <EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Enter Nickname"
    android:textColorHint="@android:color/white"
    android:id="@+id/etNickName"
    android:layout_below="@+id/imageView9"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />   


活动开始时,键盘有没有办法不立即弹出

将android:focusableInTouchMode=“true”设置为根布局

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/blue_dark"
        android:focusableInTouchMode="true"
        android:orientation="vertical">
        .
        .
        .
    </RelativeLayout>

.
.
.

只需将其写入清单文件即可

<activity
        android:name=".YourActivity"
        android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />


谢谢!这对你很有帮助…接受答案