我將選項卡作爲活動。在其中一個選項卡中,我有一個搜索對話框。當我膨脹搜索結果時,我的選項卡消失。如何在保留標籤的同時膨脹結果?如何膨脹佈局?
下面是如何膨脹的結果:
LinearLayout layout = (LinearLayout) findViewById(R.id.quick_search);
if(data==null) {
LinearLayout empty = (LinearLayout) mInflater.inflate(R.layout.empty, null);
layout.addView(empty);
}
else {
LinearLayout workRequest = (LinearLayout) mInflater.inflate(R.layout.quick_search, null);
layout.addView(workRequest);
}
其實我想到位LinearLayout
「quick_search」來顯示搜索結果,並確保上述「quick_search」的視圖不會丟失。我目前的方法膨脹的結果佔據整個屏幕。我怎樣才能避免這種情況?
它們設置爲'wrap_content'。它仍然不起作用! – Harsh 2012-07-18 01:44:46