码迷,mamicode.com
首页 > Windows程序 > 详细

popuWindow对话框

时间:2015-02-05 07:07:21      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:对话框   电话   null   短信   

  今天学了 popuWindow ,获益匪浅,所以来分享一下。

  //加载布局

                                  ViewcontentView=View.inflate(getApplicationContext(), R.layout.popu_dialog, null);

                                  //找到相应的控件进行操作1,拨打电话,2,发送短信

                                  LinearLayoutll_call=(LinearLayout)contentView.findViewById(R.id.ll_call);

                                  LinearLayoutll_sms=(LinearLayout) contentView.findViewById(R.id.ll_sms);

                                 

                                  //弹出popu对话框

                                  pw=newPopupWindow(contentView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

                                   

                                  //背景透明

                                  pw.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));

                                  //,高的数组

                                  int[] location=newint[2];

                                  view.getLocationInWindow(location);

                                  pw.showAtLocation(view,Gravity.LEFT|Gravity.TOP,30, location[1]);


popuWindow对话框

标签:对话框   电话   null   短信   

原文地址:http://9900310.blog.51cto.com/9890310/1611758

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!