2011-04-19 49 views
0

我在使用listview在RelativeLayout。在使用Efficient Adapter填充listview之後,焦點移動直接進入listview的第四個元素。當列表視圖填充項目或刷新時,我想要選擇第一項列表視圖。 下面是代碼:重點在第四個項目後listview正在填補

mAdapter_New.notifyDataSetChanged(); 
lt1.addFooterView(footerView); 
lt1.setAdapter(mAdapter_New); 
lt1.setSelection(0); 
     lt1.setSelectionAfterHeaderView(); 

佈局文件是如下:

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 

    android:layout_height="fill_parent" android:background="@color/White"> 
<RelativeLayout .... > 
    <LinearLayout ...> 

    </LinearLayout> 
</RelativeLayout> 
<ListView 
android:layout_width="fill_parent" 
android:id="@+id/listtv01" 
android:layout_alignParentTop="false" 
android:layout_below="@+id/ril_prg" 
android:layout_height="fill_parent" 
android:focusable="true" 
android:focusableInTouchMode="true" 
android:fitsSystemWindows="true" 
android:divider="@color/Grey" 
android:dividerHeight="1dip" 
android:headerDividersEnabled="false" 
android:footerDividersEnabled="false" 
android:clickable="true" 
android:background="@color/White" 
android:cacheColorHint="#00000000"> 
</ListView> 

回答

相關問題