2017-03-23 11 views
-4

私は簡単な質問があります。私は、プレイヤーがEditTextでニックネームを設定しなければならないゲームを作成しています。私は、彼らが自分の名前を入れて持っている活動への意図を起動すると、キーボードはこのように、ポップアップ表示:AndroidスタジオEditTextクリック可能

これは私の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" /> 

はキーボードがすることをどのような方法がありますアクティビティの開始時にすぐにポップアップされませんか?

答えて

0

セットの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> 
+0

あなたの中にマニフェストファイルをこれを書いてくれてありがとう!これは助けた –

+0

あなたを歓迎する...答えを受け入れる – user2025187

1

がちょうど

<activity 
     android:name=".YourActivity" 
     android:windowSoftInputMode="adjustPan|stateAlwaysHidden" /> 
関連する問題