dialog

What is difference between ` DialogInterface.dismiss()` and `DialogInterface.cancel()`? [duplicate]

蹲街弑〆低调 提交于 2019-12-21 03:34:18
问题 This question already has answers here : What is the difference between a dialog being dismissed or canceled in Android? (3 answers) Closed 2 years ago . While working with dialogs in android one can cancel it or dismiss it, But when to use dismiss and when to use cancel? what is the difference between them? Thanks in advance. 回答1: public void cancel () Since: API Level 1 Cancel the dialog. This is essentially the same as calling dismiss(), but it will also call your DialogInterface

Android AlertDialog setOnDismissListener for API lower than 17

爱⌒轻易说出口 提交于 2019-12-21 03:10:35
问题 I created an AlertDialog: private CharSequence[] _items = { "item1", "item2", "item3", "item4", "item5", "item6", "item7" }; AlertDialog.Builder daysBuilder = new AlertDialog.Builder(this); daysBuilder.setTitle("SomeCaption"); daysBuilder.setMultiChoiceItems(_items,new Boolean[] { false, true, false, false false false, true }, SetListener); daysBuilder.setPositiveButton("OK", OKListener); daysBuilder.setNegativeButton("Cancel", CancelListener); AlertDialog alert = daysBuilder.create(); alert

prevent dialog view for jquerymobile multi select control with large list of options

风格不统一 提交于 2019-12-20 23:51:13
问题 So I like the custom multi select control that jquery-mobile has and want to use it. So please don't suggest put data-role="none". But I just don't want the default behavior of the select list to open up in a new dialog window if the list of options is long. Reason I don't want that behaviour is that it is not working so well on the ipad. It becomes tough to close it using the "X" on the left of the dialog. For some reason, it is becoming unresponsive on the ipad, but works fine on the

如何删除jQuery UI对话框上的关闭按钮?

[亡魂溺海] 提交于 2019-12-20 17:14:59
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 如何在jQuery UI创建的对话框中删除关闭按钮(右上角的 X )? #1楼 一旦在元素上调用 .dialog() ,就可以在任何方便的时间找到关闭按钮(和其他对话框标记),而无需使用事件处理程序: $("#div2").dialog({ // call .dialog method to create the dialog markup autoOpen: false }); $("#div2").dialog("widget") // get the dialog widget element .find(".ui-dialog-titlebar-close") // find the close button for this dialog .hide(); // hide it 替代方法: 在对话框事件处理程序内部, this 指的是“对话”元素和 $(this).parent() 引用对话框标记容器,因此: $("#div3").dialog({ open: function() { // open event handler $(this) // the element being dialogged .parent() // get the dialog widget element .find

Hiding keyboard after calling new Activity that shows a ProgressDialog

纵然是瞬间 提交于 2019-12-20 15:38:12
问题 I'm having trouble with the on screen keyboard. I have an activity with an EditText which shows the keyboard, and a button to go to a second activity. The second activity shows a ProgressDialog on its onCreate() , does stuff, and dismisses the ProgressDialog . The problem is that while the ProgressDialog is displayed, so is the keyboard. I would like the keyboard to disappear before creating the ProgressDialog . I searched thorougly both StackOverflow and other sites, but nothing seems to

Show dialog only using Context instead of Activity instance

倖福魔咒の 提交于 2019-12-20 15:32:05
问题 I could show dialog if I uses an Activity instance but when I uses Context or Application Context instance Dialog is not showing. AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(title); builder.setMessage(msg); if (null != positiveLabel) { builder.setPositiveButton(positiveLabel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); if (null != listener) { listener.onOk(); } } }); } if

Android - Change custom dialog title background

孤街浪徒 提交于 2019-12-20 12:38:45
问题 I am creating a custom dialog and I want to know how to change the background of the title bar. I've tried two approaches: 1 - I've tried the AlertDialog.Builder method 'setCustomTitle'. I created a simple layout view comprising of a textview with layout width and height 'match_parent' and background color. When I run the app, only the top half of the title bar is showing the background color. The bottom half is still showing the default theme background color. Does anyone know why? 2 - I've

Open a second window in PyQt

大憨熊 提交于 2019-12-20 09:42:02
问题 I'm trying to use pyqt to show a custom QDialog window when a button on a QMainWindow is clicked. I keep getting the following error: $ python main.py DEBUG: Launch edit window Traceback (most recent call last): File "/home/james/Dropbox/Database/qt/ui_med.py", line 23, in launchEditWindow dialog = Ui_Dialog(c) File "/home/james/Dropbox/Database/qt/ui_edit.py", line 15, in __init__ QtGui.QDialog.__init__(self) TypeError: descriptor '__init__' requires a 'sip.simplewrapper' object but received

【自定义Dialog】封装IOS样式的圆角Dialog

喜你入骨 提交于 2019-12-20 06:56:54
###开发项目的时候经常会使用的Dialog,所以给大家分享一个类似IOS风格的Dialog。 ####源码下载链接: 源码下载 实现机制 1.先自定义一个弹出框的样式 2.自己实现MyDialog类,在里面加载自定义样式的弹出框; 3.使用时,与使用Dialog一样 具体代码 ####MainActivity.java : public class MainActivity extends AppCompatActivity { private MyDialog myDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView btn = (TextView) findViewById(R.id.click); myDialog = new MyDialog(this); myDialog.setTitle("注意");//设置标题 myDialog.setMessage("确认删除吗?");//设置内容 //调起Dialog btn.setOnClickListener(new View.OnClickListener() {

Multiple Jquery modal Dialog Boxes in one page?

自古美人都是妖i 提交于 2019-12-20 06:33:34
问题 I am brand stinking new to jquery and attempting to have a "Services" page for a tech website I am working on. I am having trouble with different services opening the same info in the window. Basically I am using the code straight from the demo. Any ideas on how to have multiple windows in the same page? Thanks! 回答1: Many modal dialog boxes have the ability to insert data into the modal dialog by use of an iFrame. I'm not sure which plugin you are using (or the built-in jQuery ones I guess)