首页 > 其他 > 详细

用Dialog 做自定义动画,加播放监听

时间:2014-09-03 12:32:36      阅读:394      评论:0      收藏:0      [点我收藏+]
final Dialog customDialog = new Dialog(this);

customDialog.setTitle(R.string.attention);

customDialog.setContentView(R.layout.connectionview);

ImageView image = (ImageView)customDialog.findViewById(R.id.anim);

image.setBackgroundResource(R.drawable.connection);

customDialog.setOnShowListener(new DialogInterface.OnShowListener(){

  public void onShow(android.content.DialogInterface dialog){

    ImageView image =(ImageView)customDialog.findViewById(R.id.anim);

    AnimationDrawable ad = (AnimationDrawable)image.getBackground();

    if(ad != null) {
  
    ad.start();

  }

}

});



customDialog.show();



这里利用的onShowListener,注意这个接口需要高版本的SDK。

 

用Dialog 做自定义动画,加播放监听

原文:http://www.cnblogs.com/niray/p/3953138.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!