實際上它不是ListView,而是ExpandableListView,但它並不重要。通常我會這樣做:在下面添加一個LinearLayout ListView
<ScrollView >
<LinearLayout>
<ExpandableListView ... />
<TextView ... />
</LinearLayout>
</ScrollView>
..但我讀過它很耗費ListView裏面的ScrollView。我試圖通過修改ExpandListAdapter解決這個(getChildView()):
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View view, ViewGroup parent) {
if(isLastChild){
LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.extra_info_bottom, null);
}
else{
//get normal item view
}
return view;
}
但這樣一來,我只能追加孩子的團體。我怎樣才能將LinearLayout追加到任何組的底部?
檢查你的包中導入了哪個'LayoutParams'? –
其實我因爲語法錯誤而得到了以前的錯誤。請查看我的回答(最後一段)! –