dialog

Android: Close dialog window on touch

允我心安 提交于 2019-12-18 02:42:48
问题 I'd like to close a dialog window in my android app by simply touching the screen.. is this possible? If so, how? I've looked into setting some "onClickEven" on the dialog, but it doesnt exist. How would this be possible? 回答1: You can use dialog.setCanceledOnTouchOutside(true); which will close the dialog if you touch u=outside the dialog. 回答2: If your dialog contains any view try to get the touch events in that view and dismiss your dialog when user touch on that view. For example if your

PyQt tutorial 5-Dialogs in PyQt5

六月ゝ 毕业季﹏ 提交于 2019-12-18 01:56:29
对话框 Dialog windows or dialogs are an indispensable(不可或缺) part of most modern GUI applications. A dialog is defined as a conversation between two or more persons. In a computer application a dialog is a window which is used to “talk” to the application. A dialog is used to input data, modify data, change the application settings etc. 1. QInputDialog QInputDialog provides a simple convenience dialog to get a single value from the user. The input value can be a string, a number, or an item from a list. #!/usr/bin/python3 # -*- coding: utf-8 -*- """ ZetCode PyQt5 tutorial In this example, we

Android - Executing a custom listview in a custom dialog properly

删除回忆录丶 提交于 2019-12-18 01:11:30
问题 I have an application where I would want to display a custom list view consisting of two textViews inside a custom dialog box in android. So far, I'm having a difficult time figuring out how to connect the two and generate the contents of the dialog box. I tried to follow custom listView tutorials with the hopes of just setting the dialog adapter to it but to no avail. So far, this is what I have so far: This is list_row_dialog.xml, the layout for the row containing two textviews: <?xml

Android - Executing a custom listview in a custom dialog properly

纵饮孤独 提交于 2019-12-18 01:11:29
问题 I have an application where I would want to display a custom list view consisting of two textViews inside a custom dialog box in android. So far, I'm having a difficult time figuring out how to connect the two and generate the contents of the dialog box. I tried to follow custom listView tutorials with the hopes of just setting the dialog adapter to it but to no avail. So far, this is what I have so far: This is list_row_dialog.xml, the layout for the row containing two textviews: <?xml

jQuery UI dialog button focus

痴心易碎 提交于 2019-12-17 23:06:04
问题 When a jQuery UI dialog opens, it selects one of the buttons and highlights it or sets focus to it etc... How can I stop this behaviour so that none of the buttons are highlighted when the dialog opens? EDIT : I tried the following in the dialog options, which didn't remove focus from the buttons: ... open:function(event, ui) { $("myunimportantdiv").focus(); }, ... NOTE : As a temporary workaround I modified the CSS for .ui-state-focus but this isn't ideal... 回答1: Use the blur method. You can

Creating a custom dialog in Android

不想你离开。 提交于 2019-12-17 22:41:58
问题 I am trying to create a custom dialog in Android. But whatever I tried to do, I am not able to change the width of the dialog. It just remains the same. The following is the view that I am setting as the content for the dialog. <RelativeLayout android:id="@+id/current_stats" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="visible"> <ImageView android:id="@+id/player_image" android:src="@drawable/person" android:layout_width="wrap_content" android

Custom screen dim with Dialog

青春壹個敷衍的年華 提交于 2019-12-17 22:34:04
问题 In Android when you pop up a dialog the screen behind it dims. Is there any way to control what that looks like? For example making it dim more or less or using some kind of a pattern? 回答1: Yes, it is. You can control it. After creating dialog: WindowManager.LayoutParams lp = dialog.getWindow().getAttributes(); lp.dimAmount=0.0f; // Dim level. 0.0 - no dim, 1.0 - completely opaque dialog.getWindow().setAttributes(lp); Upd : you can even add blur behind the dialog: dialog.getWindow().addFlags

showDialog deprecated. What's the alternative?

空扰寡人 提交于 2019-12-17 22:04:52
问题 Is there something else that should be called? showDialog(TIME_DIALOG_ID); It's in this tutorial but says deprecated in Eclipse. 回答1: From http://developer.android.com/reference/android/app/Activity.html public final void showDialog (int id) Added in API level 1 This method was deprecated in API level 13. Use the new DialogFragment class with FragmentManager instead; this is also available on older platforms through the Android compatibility package. Simple version of showDialog(int, Bundle)

How to handle a webview confirm dialog?

一世执手 提交于 2019-12-17 21:56:32
问题 I'm displaying a webpage in a WebView and on the webpage, there is a button. When you click the button, a confirmation dialog is supposed to popup, but it doesn't show in my WebView. It does popup if I go to the same webpage in the android browser. Anyone know how to handle popup dialogs coming from a webpage inside your WebView? 回答1: Ok, found the answer and here it is! In order to handle a popup confirmation coming from a webpage in your WebView, you need to override the onJsConfirm method

PyQt: Put scrollbars in this

六月ゝ 毕业季﹏ 提交于 2019-12-17 20:25:10
问题 Here's my class: class ChildFoundDlg(QDialog): #__init__ function: def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.resize(500, 270) self.setMaximumSize(500, 540) self.GridLayout = QtGui.QGridLayout(self) def buttons(self, a, b, c): #a = 0, b = 5 c = 7 self.font = QtGui.QFont("Sans Serif", 10, QFont.Normal) self.label = QtGui.QLabel(self) self.label.setText(QtGui.QApplication.translate("Form", "Μήπως εννοείτε την/τον:", None, QtGui.QApplication.UnicodeUTF8)) self