2011-04-19 3 views
0

RelativeLayout에서 listview를 사용하고 있습니다. Listview에 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> 

답변

관련 문제