2011-09-19 9 views
2

検索ボタンの虫めがねをテキスト "検索"に変更することが可能かどうか疑問に思っていました。特定のイベントに応答するため、imeOptions設定をandroid:imeOptions = "actionSearch"に保存します。アンドロイド - imeOptionsに虫眼鏡の代わりに "検索"と言うボタンがあります

<EditText 
     android:id="@+id/txtSearch" 
     android:textSize="14px" 
     android:textColor="@color/main_text_black" 
     android:layout_width="189px" 
     android:layout_height="fill_parent" 
     android:imeOptions="actionSearch" 
     android:gravity="center_vertical" 
     android:singleLine="true" 
     android:background="@null" 
     android:layout_alignParentLeft="true" 
     android:layout_marginLeft="24px"/> 

enter image description here

はこれを試し:ここ

は私が持っているものである

<EditText 
    android:id="@+id/txtSearch" 
    android:textSize="18dp" 
    android:textColor="@color/main_text_black" 
    android:layout_width="247dp" 
    android:layout_height="fill_parent" 
    android:imeOptions="actionSearch" 
    android:imeActionLabel="Search" 
    android:gravity="center_vertical" 
    android:singleLine="true" 
    android:background="@null" 
    android:layout_alignParentLeft="true" 
    android:layout_marginLeft="38dp"/> 

enter image description here

我々のアプリがサポートされていない風景モードでのみ動作し、検索の単語が間違って表示される場所。

+0

が重複する可能性:http://stackoverflow.com/questions/7156427/android-keyboard-go-button-to-search/7156494#7156494 – NSjonas

+0

が、それはまた、風景モードでは、portretビューで動作しませんでしたまだ虫眼鏡を持っていて、検索語はトップでは上書きされますが、必要な場所では上書きされません。 – dropsOfJupiter

+0

あなたはandroid:imeActionLabel = xmlの指定されていない属性を持つ "Search"を変更しましたか、実行時にjavaを使用していましたか? – NSjonas

答えて

0

いいえ、このEditTextに独自のキーボードを実装しない限り不可能です。キーボードのキーのテキスト(またはアイコン)は、キーボードを書いた人によって制御されます。

2

お試しください!

<EditText 
     android:id="@+id/edt_search_1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:imeOptions="actionSearch" 
     android:inputType="text"/> 
関連する問題