2012-09-28 63 views
0

我的應用程序中有一個運行正常的搜索對話框。我的問題是:是否可以修改搜索對話框,以便在ListView填充時輸入文本字段和搜索按鈕(位於屏幕頂部)不會消失?因此,我希望輸入界面始終存在,直到通過單擊列表項目移開搜索活動。甚至更好,只有當輸入接口被操作時,軟件鍵盤纔會出現?是否可以在2.2中調整爲Android搜索對話框?Android搜索對話框修改?

I would like this searchbar NOT disappear when the ListView populates

我想從搜索對話框這個搜索欄保持在ListView的填充。

回答

0

是嘗試使用線性佈局如下

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

--------your search bar layout 

<ListView 
    android:id="@+id/list" 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" 
    > 

如果你需要它作爲一個警告對話框簡單地套用主題屬性的對話框,其中有這樣的佈局

+0

「搜索對話框」不是「搜索欄」。 – bancer

+0

是搜索對話框不是搜索欄。我只是用它,因爲他有興趣將其拼寫成搜索對話框 –

0

根據活動Activity life cycle文件:

活動可以頻繁地進出的前景 - 對於 示例,onPause()在設備進入休眠或出現對話框時被調用。

我想這意味着你不能改變ListView的狀態,直到顯示對話框。