簡體   English   中英

Android ime actionGo在某些設備上不起作用

[英]Android ime actionGo doesn't work on certain devices

ime actionGo根本無法在某些設備上運行,例如HTC Evo 4G。 它適用於Motorola Atrix和DroidX。

這是代碼:

<EditText
            android:id="@+id/password"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_centerHorizontal="true"
            android:hint="@string/password_hint"
            android:password="true"
            android:inputType="textPassword"
            android:autoText="false"
            android:imeOptions="actionGo"/>


TextView.OnEditorActionListener listener = new TextView.OnEditorActionListener()
    {
        public boolean onEditorAction(TextView exampleView, int actionId, KeyEvent event) 
        {
            if(actionId == EditorInfo.IME_ACTION_GO)
            {
                loginValidation();
            }

            return true;
    }};

    password.setOnEditorActionListener(listener);

這似乎是一個錯誤。 不同的制造商為他們的手機制作了一個定制的鍵盤,該鍵盤可能無法完全像android標准鍵盤那樣工作。 此問題以前曾提出過。 大多數人通過覆蓋onKey事件或使用TextWatcher類來解決此問題。 已提交有關此問題的錯誤

http://code.google.com/p/android/issues/detail?id=2882

我最近遇到了這個問題,如果您不擔心用戶能夠通過鍵盤添加行,則可以使“開始”按鈕顯示出來:

android:singleLine="true"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM