検索ボタンの虫めがねをテキスト "検索"に変更することが可能かどうか疑問に思っていました。特定のイベントに応答するため、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"/>
はこれを試し:ここ
は私が持っているものである<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"/>
我々のアプリがサポートされていない風景モードでのみ動作し、検索の単語が間違って表示される場所。
が重複する可能性:http://stackoverflow.com/questions/7156427/android-keyboard-go-button-to-search/7156494#7156494 – NSjonas
が、それはまた、風景モードでは、portretビューで動作しませんでしたまだ虫眼鏡を持っていて、検索語はトップでは上書きされますが、必要な場所では上書きされません。 – dropsOfJupiter
あなたはandroid:imeActionLabel = xmlの指定されていない属性を持つ "Search"を変更しましたか、実行時にjavaを使用していましたか? – NSjonas