如何在回收項(xiàng)目出現(xiàn)時(shí)動(dòng)態(tài)顯示它們當(dāng)出現(xiàn)“回收視圖”項(xiàng)目時(shí),我如何才能對(duì)其進(jìn)行動(dòng)畫(huà)化?默認(rèn)的項(xiàng)目動(dòng)畫(huà)只有在數(shù)據(jù)被添加或刪除后,再回收者數(shù)據(jù)已經(jīng)設(shè)置動(dòng)畫(huà)。我是新開(kāi)發(fā)的應(yīng)用程序,不知道從哪里開(kāi)始。有什么辦法可以做到嗎?
3 回答

湖上湖
TA貢獻(xiàn)2003條經(jīng)驗(yàn) 獲得超2個(gè)贊
Recyclerview
private final static int FADE_DURATION = 1000; //FADE_DURATION in milliseconds@Overridepublic void onBindViewHolder(ViewHolder holder, int position) { holder.getTextView().setText("some text"); // Set the view to fade in setFadeAnimation(holder.itemView); }private void setFadeAnimation(View view) { AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f); anim.setDuration(FADE_DURATION); view.startAnimation(anim);}
setFadeAnimation()
setScaleAnimation()
private void setScaleAnimation(View view) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(FADE_DURATION); view.startAnimation(anim);}
RecyclerView
RecyclerView
- 3 回答
- 0 關(guān)注
- 359 瀏覽
添加回答
舉報(bào)
0/150
提交
取消