zoukankan      html  css  js  c++  java
  • 用Dialog 做自定义动画,加播放监听

    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。
  • 相关阅读:
    request相关
    C#请求接口
    qml_base
    web
    entry
    listbox
    Canvas
    pickle
    c#枚举
    数据结构——树
  • 原文地址:https://www.cnblogs.com/niray/p/3953138.html
Copyright © 2011-2022 走看看