Ask the experts: If that, I click on the dialog box how to achieve it, as usual logic, if you click outside of the area of the dialog, then the dialog will automatically shut down, and how to achieve it? Consult experts, I am a rookie, online. . .
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Use PopupWindow
Reply:
With AlertDialog not?
It should be specific with PopupWindow how to use it?
Thank you
Reply:
Talk about my ideas, this can be achieved, I looked at where we are now products on doing, but doing it too much trouble, especially since the definition of the dialog
The whole dialog is set to full screen transparent, view you want to display the dialog box, the dialog is set to touch event handling, and get the current view of the size and coordinates (upper right corner coordinates), compare the current touch point is within the range of view.
Reply:
Dialog can only be done with it? Close the dialog box can be triggered when it loses focus?
Reply:
How no one to answer ah? ?
Or how in the dialog box's title bar to add a close button, just like the pop-up dialog windows as the top right there is a button to close the window
Reply:
The key is not the box, but the box has not been focused, and if it is focused pop, otherwise it can be turned off
Reply:
Try
setCanceledOnTouchOutside (true) ;/ / Cancel dialog box is displayed outside the dialog box click
Reply:
The click of a button and then pop the dialog, you mean when they were focused pop, mouse clicks outside the dialog area is not focused then close it?
Reply:
This still does not work ah
Reply:
You mean the upper right corner to close alertdialog? I want to ask you alertdialog are new to still be able to use a more casual
Reply:
Well, new to, Oh, not very good yet
Reply:
You can go online to find alertdialog creation, the upper right corner there is a default dialog X, click can turn off alertdialog, came into contact with no need to do so complicated, saw your post on the issue thought you were very familiar to alertdialog the
Reply:
Ha ha ha, is not familiar to me, but now there is this need to do something, so I ask this question directly. . . .
Top right corner of the default dialog box has a X?
I'm so new AlertDialog.Builder (MyStockActivity.this). Create () in the upper right corner there is no x eh
Reply:
I think that using onKeyDown (); event better, just a thought. .
Reply:
Try
setCanceledOnTouchOutside (true) ;/ / Cancel dialog box is displayed outside the dialog box click
What do you use to test a bad phone use? ? I use a samsung phone tests normal way
Reply:
onKeyDown () instead of pressing the keyboard when the event is triggered it? How to use this one?
Reply:
I use the android emulator. . .
alertDialog.setCanceledOnTouchOutside (true) so the list? Ha ha ha, I am a novice. . .
Reply:
protected Dialog onCreateDialog (int id) {
Dialog dd = new AlertDialog.Builder (this). SetTitle ("delete"). SetIcon (
android.R.drawable.ic_dialog_alert). setMessage ("Are you sure you want to delete a contact?")
. SetNegativeButton (android.R.string.cancel, null)
. SetPositiveButton (android.R.string.ok,
new DialogInterface.OnClickListener () {
@ Override
public void onClick (DialogInterface dialog,
int which) {
/ / TODO Auto-generated method stub
delPersion ();
}
.}) Create ();
dd.setCanceledOnTouchOutside (true);
return dd;
}
Yeah, I also use the simulator is to click on the place outside dialg
Reply:
Huh. . . I told you about, ah, I was like ah
AlertDialog ad = new AlertDialog.Builder (this) create ();.
ad.setTitle (getString (R.string.choose));
ad.setCanceledOnTouchOutside (true);
ad.setView (textEntryView);
ad.show ();
But this is not my side eh
Reply:
I do not know, me and you change the same, I am fine with,
Reply:
Hey strange. . . But thank How about you huh
Reply:
I do not work here, because too much dialog, click on the outside did not respond, I get a little small dialog box, on it. . .
Reply:
I realized this, let this dialog has focus, in this dialog box to set the background in showAsDropDown set this popupwindow.setBackgroundDrawable (new BitmapDrawable ()) before () method;
If not, you can add me QQ478319399
Reply:
I have a custom DIalog this role
Reply:
Thank you very much, setCanceledOnTouchOutside (true); in the Custom Dialog is available, but require () was registered in the onCreate look
Reply:
How to register onCreate () inside ah?
Reply:
http://zhidao.baidu.com/question/462496579.html
Reply:
Brother, you look at the parameters! Is true, you can change the false, the rookie passing!
Reply:
Try
setCanceledOnTouchOutside (true) ;/ / Cancel dialog box click dialog external display Dialog, this is possible. I have used ah
Reply:
setCanceledOnTouchOutside (true);
Really good with

Reply:
Customize dialog accordance upstairs said method simply does not work
Reply:
setCanceledOnTouchOutside (false); this job, do not use true

Reply:
I just used what should dialog.setCanceledOnTouchOutside (false); Properties dialog box, click outside this will not automatically cancel the dialog
No comments:
Post a Comment