2011-12-19 11 views
1

AndroidのGoogle検索のコードはどこかありますか? xml-layoutは私のためには十分でしょう。または、コーナーにアイコンを追加するのと同じように、EditTextの右側にボタンを追加する可能性がありますか?ありがとう。 enter image description hereAndroid EditTextのようなGoogle検索EditText

+1

[my answer ** here **](http://stackoverflow.com/a/11093987/1050058)が表示されます。アイコンを右に変えるのは簡単です。最初に自分自身を試してください。私は後で別のスニペットを追加します右のアイコンを –

答えて

1

EditText、検索画像を含むImageView、マイク画像のImageViewを持つことができる水平方向のLinearLayoutがあります。それらのすべては、1つのように見えるように、そのようにカットされた必要な背景画像を有するべきである。これは一般的な概念です。

ソースコードに関して、私はあなたを助けることができません!

希望すると便利です。

+0

それを行うには管理?何か助けがいるか? –

2
<LinearLayout 
     android:id="@+id/mainLayout" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/bar"//set back ground for total look 
     android:orientation="horizontal" >    
     <EditText 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:hint="Your hint" 
      android:drawableRight="@drawable/search"//give your search icon 
      android:id="@+id/editBox" 
         />    
     <Button     
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/imageSpeak" 
      android:background="@drawable/iconSpeak"//icon for speak 
      /> 


</LinearLayout>