朋友。將腳註添加到列表視圖時出現問題。我已經使用下面的代碼來添加footerview。將footerview添加到列表視圖
TextView totalIncome = new TextView(this);
TextView totalExpense = new TextView(this);
totalIncome.setGravity(Gravity.CENTER);
totalExpense.setGravity(Gravity.CENTER);
totalIncome.setPadding(0, 5, 0, 5);
totalExpense.setPadding(0, 5, 0, 5);
totalIncome.setText("Total Income is : " + tIncome + "");
totalExpense.setText("Total Expense is : " + tExpense + "");
final ListView lv1 = (ListView) findViewById(R.id.ListView);
lv1.addFooterView(totalIncome);
lv1.addFooterView(totalExpense);
lv1.setAdapter(adapter);
但我的問題是,當動態地改變列表內容的footerview下降了一些步驟。我不是爲什麼它在移動。請幫助我的朋友。
對於裁判:
改變內容
看到列表footerview朋友之間的差距後。我不想要這個空間。我在嘗試更改內容時刪除了footerview。但我不能。我通過互聯網搜索了很多。但我沒有找到任何解決方案的朋友。請幫忙。提前致謝。
如果添加另一個數據,頁腳視圖會向下移動? – 2013-03-20 05:44:21