2011-06-27 16 views
2

アンドロイドアプリレイアウト内でカスタム検索を作成するにはどうすればよいですか?私は活動ウィンドウの上部に表示されますが、私はここに画像のようなものをご希望の検索ダイアログを使用することができる午前アンドロイドでカスタム検索を作成する(レイアウトに検索ウィジェットを挿入する)

http://img5.imageshack.us/img5/1298/customsearch.gif

サンプルコードが用意されていた場合

custom searchview、Iそんなに感謝します。

ありがとうございます。

私の英語については残念です。

+0

としてのresフォルダの検索レイアウトを作ります。 html – Herry

答えて

0

あなたはアンドロイドhttp://developer.android.com/resources/samples/SearchableDictionary/indexで検索メイクのために、このリンクを参照することができますちょっとジョセフ@

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:background="@android:color/white" > 

     <LinearLayout 
      android:orientation="horizontal" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:background="@android:color/white"> 

      <EditText 
        android:id="@+id/searchText" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1"/> 

      <Button 
        android:id="@+id/searchButton" 
        android:text="Search" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:onClick="search"/> 

     </LinearLayout> 

     <ListView 
      android:id="@android:id/list" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:background="@android:color/white"/> 

</LinearLayout> 
関連する問題