【问题标题】:google plus recyclerView scrolling animationgoogle plus recyclerView 滚动动画
【发布时间】:2016-07-02 01:28:41
【问题描述】:

我想知道如何使用 google plus 应用程序等动画为 recyclerView 设置动画。在这里我有一个答案How to animate recyclerview on scroll like Google plus/Google newsstand?,但我对上下文和“最后位置”的事情有疑问,他说创建一个字段,但我不知道这意味着什么。

【问题讨论】:

    标签: android animation android-recyclerview


    【解决方案1】:

    试试这个:

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
    
            //Your content here
    
            setAnimation(holder.itemView);
    }
    
    
    private void setAnimation(ViewHolder holder) {
                ObjectAnimator.ofFloat(holder.itemView, "translationX", initialValue, finalValue)
                        .setDuration(1000)
                        .start();
            }
    

    请参阅此link 了解更多信息

    【讨论】:

      猜你喜欢
      • 2014-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多