2011-12-17 7 views
3

私はアニメーションを持つリストビューを持っています。 ListViewが最初に読み込まれると、アニメーションがうまく再生されます。私は、カーソルを変更するとアニメーションを再生したい。カーソルを変更してリストビューアニメーションを再生

<ListView 
    android:id="@android:id/list" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:cacheColorHint="@android:color/transparent" 
    android:divider="@drawable/gradienthorizontal" 
    android:dividerHeight="1px" 
    android:layoutAnimation="@anim/layout_cascade" 
    android:listSelector="@drawable/selector" > 
</ListView> 

私はここで、カーソルを変更します。

private void majCurseurListe(long id, boolean choixvente) { 
    Cursor curseurPtVente = null; 

    if (choixvente) { 
     curseurPtVente = mDbHelper 
       .listePtsVentes(DBhelper.TYPE_PTVENTE, id); 
    } else { 
     curseurPtVente = mDbHelper.listePtsVentes(DBhelper.TYPE_PTSERVICE, 
       id); 
    } 

    // Android s'occupe du cycle de vie du curseur 
    startManagingCursor(curseurPtVente); 
    ((CursorAdapter) getListAdapter()).changeCursor(curseurPtVente); 
} 

答えて

5

ちょうど

listView.startLayoutAnimation(); 
+0

非常に素晴らしい感謝を呼び出します! –

関連する問題