3

これは私にとって非常に紛らわしい動作であり、私の問題を正確に抱えている人を他に見つけることができません。

ログイン アクティビティを作成しようとしていますが、これまでのところ、ユーザー名フィールドで多くの問題が発生しています。テキストフィールドは何があってもフォーカスされたままです。

外側をクリックしてもフォーカスが失われません。他のフィールドをクリックすることも、キーボードを閉じることもできません。退出はバックボタンのみ動作します。SingleLineMaxLinesおよび...のすべての組み合わせを使用して、1行のフィールドにしようとしました。またLines、ImeOptions/ImeActionIdも使用しようとしましactionNextたが、これも効果がありませんでした。

trueに設定しても新しい行を作成し続けるEnterボタンを頑固に保持しSingleLineます。

現在、私のxmlは次のようになっています。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".LoginActivity"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_horizontal"
    android:paddingTop="@dimen/spacing_huge">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/mini_logo"/>
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="@dimen/spacing_huge">
        <ImageView
            android:layout_width="fill_parent"
            android:src="@drawable/orange_ring"
            android:layout_height="fill_parent"/>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_centerInParent="true">


            <EditText
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/loginUsername"
                android:hint="Username"
                android:imeOptions="actionNext"
                android:singleLine="true"/>

            <EditText
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/loginPassword"
                android:hint="Password"
                android:inputType="textPassword"
                android:textAlignment="center"
                android:maxLines="1"
                android:singleLine="true"
                android:imeActionId="6"/>

            <Button
                android:id="@+id/loginButton"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:text="login!"
                android:onClick="userLogin"/>

        </LinearLayout>

    </RelativeLayout>

</LinearLayout>

編集:ええと、すみません、質問するのを忘れていました。誰かが私に何が起こっているのか、何かを誤解したのか、またはこれを修正する方法を教えてもらえますか? :) 今何ができるのか本当にわかりません。ご協力いただきありがとうございます。

4

2 に答える 2