展会信息港展会大全

android layout animation
来源:互联网   发布日期:2015-10-13 12:45:27   浏览:1914次  

导读:android layout animation1.[代码][Java]代码public class LayoutAnimation extends ListActivity {@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState)......

android layout animation

1. [代码][Java]代码

public class LayoutAnimation extends ListActivity {

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mStrings));

AnimationSet set = new AnimationSet(true);

Animation animation = new AlphaAnimation(0.0f, 1.0f);

animation.setDuration(1000);

set.addAnimation(animation);

animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);

animation.setDuration(1000);

set.addAnimation(animation);

LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);

ListView listView = getListView();

listView.setLayoutAnimation(controller);

}

private String[] mStrings = { "Bordeaux", "Lyon", "Marseille", "Nancy", "Paris", "Toulouse", "Strasbourg" };

}

赞助本站

人工智能实验室

相关热词: layout animation

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港