使用popupwindow弹出的窗体里面的button响应怎么做??

解决方案 »

  1.   

    Button是放在PopupWindow里面的View中,那么你的Button直接调用setOnClickListener不就可以了?
      

  2.   


    LayoutInflater layoutInflater = (LayoutInflater)(PVZ_login.this).getSystemService(LAYOUT_INFLATER_SERVICE);
     // 获取自定义布局文件poplayout.xml的视图
     View popview = layoutInflater.inflate(R.layout.XXX, null);
     PopupWindow popWindow = new PopupWindow(popview,LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);你的意思是 把button放在XXX.xml中??我就是这样做的 但是button无法点击
      

  3.   

    popupView=LayoutInflater.from(DiaAllActivity.this).inflat(R.layout.dia_cuspopup_dia, null);  
    cusPopupBtn1=(Button)popupView.findViewById(R.id.diaCusPopupSure);  
    button也放在popup 的布局文件中然后和不同的button一样了