设为首页 加入收藏

TOP

Android开发笔记: 5种对话框案例(十)
2017-10-13 10:37:05 】 浏览:3734
Tags:Android 开发 笔记 对话 案例
bsp; 
  •                     }    
  •                 }    
  •                 // 在进度条走完时删除Dialog    
  •                 progress.dismiss();    
  •         
  •             }    
  •         }).start();    
  •           
  •     }  

  •  

     

     

     

     

     

     

     

     

    5 popuWindow对话框

     

     

    [csharp]  view plain  copy
     
    1. Button btn_popu;  
    2.     //popuWindow对话框  
    3.     public void showPopuWindow(View v){  
    4.           
    5.         btn_popu = (Button) v;  
    6.         // 设置布局  
    7.         View view = LayoutInflater.from(this).inflate(R.layout.pop_window, null);  
    8.           
    9.         PopupWindow window = new PopupWindow(this);  
    10.         window.setContentView(view);  
    11.         window.setWidth(360);  
    12.         window.setHeight(200);  
    13.   
    14.         int[] location = new int[2];  
    15.         // 获取按钮坐标  
    16.         btn_popu.getLocationInWindow(location);  
    17.         window.setFocusable(true);  
    18.         window.setBackgroundDrawable(getResources().getDrawable(R.drawable.back_null));  
    19.         window.showAtLocation(btn_popu, Gravity.LEFT |Gravity.TOP , location[0]+ btn_popu.getWidth(), location[1] + 0 );  
    20.           
    21.         //showToastMsg("" + (location[0]+ btn_popu.getWidth())+"   "+&
    首页 上一页 7 8 9 10 下一页 尾页 10/10/10
    】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
    上一篇android企业级商城源码、360°全.. 下一篇viewpager无线轮播获取网络图片

    最新文章

    热门文章

    Hot 文章

    Python

    C 语言

    C++基础

    大数据基础

    linux编程基础

    C/C++面试题目