1

我有一个片段工作正常的应用程序,但是当一个按钮被录音时,我显示一个弹出窗口,是一个小窗口,所以一些按钮不在视图中,可以点击,

那么如何禁用其他按钮,当我弹出窗口时,

public class Tab2HeadH1 extends Fragment   implements OnClickListener{

    //testeo popero


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {



        View view = inflater.inflate(R.layout.tab_2_head_buttons, container,false);



        //Buttons

        final Button buttonNose = (Button) view.findViewById(R.id.button_pop_nose);

        buttonNose.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(final View v) {
              //aqui tus tareas,,

                LayoutInflater layoutInflater = (LayoutInflater)getActivity().getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

               View popupView = layoutInflater.inflate(R.layout.popup, null);  
                        final PopupWindow popupWindow = new PopupWindow(
                          popupView, 
                          LayoutParams.WRAP_CONTENT,  
                                LayoutParams.WRAP_CONTENT);

                        Button btnDismiss = (Button)popupView.findViewById(R.id.dismiss);
                        btnDismiss.setOnClickListener(new Button.OnClickListener(){

                @Override
                public void onClick(View v) {
                 // TODO Auto-generated method stub
                 popupWindow.dismiss();
                }});

                        popupWindow.showAsDropDown(buttonNose, 50, 30);




            }



        });





        Button buttonEye = (Button) view.findViewById(R.id.button_pop_eye);

        buttonEye.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(final View v) {
               // onLoginClicked(v);
                Toast.makeText(getActivity(), "ss9 eye",
                        Toast.LENGTH_SHORT).show();

            }
        });

return view;
    }



    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {

        super.onViewCreated(view, savedInstanceState);



        ((TabActivity)getActivity()).setHeader("TAPING APPLICATION");
    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        switch (v.getId()) {



        }
    }


}

谢谢

4

0 回答 0