• Animation显示ListView的每一条记录


    activity_main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context=".activity.MainActivity">
        <ListView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/listView"></ListView>
    </LinearLayout>

    zoom_in.xml

    <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
    
        <scale android:duration="1000"
            android:fromXScale="0.1"
            android:fromYScale="0.1"
            android:pivotX="50%"
            android:pivotY="50%"
            android:toXScale="1.0"
            android:toYScale="1.0"/>
    
        <alpha android:duration="1000"
            android:fromAlpha="0"
            android:toAlpha="1.0"/>
    
    </set>

    MainActivity.java

    package com.pingyijinren.helloworld.activity;
    
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.animation.AnimationUtils;
    import android.view.animation.LayoutAnimationController;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;
    
    import com.pingyijinren.helloworld.R;
    
    public class MainActivity extends AppCompatActivity {
        private ListView listView;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            listView=(ListView)findViewById(R.id.listView);
            listView.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,new String[]{"work hard","make money","I want to be rich"}));
    //        listView.setAnimation(AnimationUtils.loadAnimation(MainActivity.this,R.anim.zoom_in));
            listView.setLayoutAnimation(new LayoutAnimationController(AnimationUtils.loadAnimation(MainActivity.this,R.anim.zoom_in)));
        }
    }
  • 相关阅读:
    MySQL IO线程及相关参数调优
    mysql InnoDB index 主键采用聚簇索引,二级索引不采用聚簇索引
    Mysql怎么判断繁忙 checkpoint机制 innodb的主要参数
    遇见 TiDB
    TiDB 深度实践之旅--真实“踩坑”经历
    tidb使用坑记录
    MySQL mysql server与存储引擎
    DBProxy 读写分离使用说明
    DBProxy 项目全解
    Mysql 数据库意向锁意义
  • 原文地址:https://www.cnblogs.com/zqxLonely/p/5555707.html
Copyright © 2020-2023  润新知