嗨,我所有我做一個示例應用程序。爲更新列表。 我有一個列表類,它的xml就像。在TextView中的問題android
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id="@+id/ListView01" android:layout_height="wrap_content"
android:layout_width="fill_parent"></ListView>
<TextView android:id="@+id/more"
android:layout_height="wrap_content"
android:text="Click to view more..."
android:textStyle="normal|bold" android:textColor="#FF8000" android:textSize="10dip"
android:gravity="center_vertical|center_horizontal" android:layout_width="fill_parent">
</TextView>
</LinearLayout>
現在我已經設定的文本視圖TouchListener和下面的代碼添加它
@Override
public boolean onTouch(View v, MotionEvent event) {
switch(v.getId())
{
case R.id.more:
//update List Method Call..
more.setText("Click to view More..");
adapter.notifyDataSetChanged();
}
// TODO Auto-generated method stub
return false;
}
您對我已經添加
more.setText("Click to view More..");
線switch語句的3號線看到,當我的列表更新。文本視圖不再顯示在底部。 請引導我爲什麼這發生在我身上,最新的解決方案?
在開始你的TextView是顯示在列表的底部..? – 2011-05-16 05:30:04
是在開始顯示。但當它列表得到update.it消失 – Shah 2011-05-16 05:33:35
並在開始listview有任何數據。? – 2011-05-16 05:38:08