2012-05-31 49 views
-5

如何將搜索框放在頂部,就像在android的默認瀏覽器中一樣?我不是指搜索小部件,我的意思是一個搜索對話框,在活動的頂部持續存在。像瀏覽器一樣的搜索框

回答

0

您可以設置不同的佈局,並在最上面的一個,你可以設置一個的LinearLayout與android:height="wrap_content"android:width="fill_parent" 並設置有weightsum 10和搜索欄的LinearLayout父LinearLayout中會有android:weight="1" 第二種佈局將與9:1的重量

所以如:

Linearlayout (weightsum=10) 
LinearLayout (with searchbar) weight=1 
LinearLayout (with the other content) weight = 9 
相關問題