2014-02-11 34 views

回答

0

使用此代碼段

public void helpOverlay(){ 

    final Dialog dialog = new Dialog(this); 
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); 
    dialog.setContentView(R.layout.coach_mark); 
    dialog.setCanceledOnTouchOutside(true); 
    View masterView = dialog.findViewById(R.id.coach_mark_master_view); 
    masterView.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View view) { 
      dialog.dismiss(); 
     } 
    }); 
    dialog.show(); 
} 

here is a github project