Tag: 对话框

快速警报视图(iOS8)与确定和取消button,哪个button点击

我在Swift中编写了一个警告视图,我想确定用户select了哪个button(这是一个确认对话框),什么都不做或者执行。 目前我有: @IBAction func pushedRefresh(sender: AnyObject) { var refreshAlert = UIAlertView() refreshAlert.title = "Refresh?" refreshAlert.message = "All data will be lost." refreshAlert.addButtonWithTitle("Cancel") refreshAlert.addButtonWithTitle("OK") refreshAlert.show() } 我可能使用错误的button,请纠正我,因为这对我来说都是新的。 谢谢!

将CSS应用到jQuery对话框button

所以我现在有一个jQuery对话框有两个button:保存和closures。 我使用下面的代码创build对话框: $dialogDiv.dialog({ autoOpen: false, modal: true, width: 600, resizable: false, buttons: { Cancel: function() { // Cancel code here }, 'Save': function() { // Save code here } }, close: function() { // Close code here (incidentally, same as Cancel code) } }); 但是,使用此代码时,两个button都是相同的颜色。 我想我的取消button是一个不同于我的保存颜色。 有没有办法做到这一点使用一些内置的jQuery选项? 我没有从文档中获得很多帮助。 请注意,我正在创build的取消button是一个预定义的types,但是“保存”我正在定义自己。 不知道这是否会影响到这个问题。 任何帮助,将不胜感激。 谢谢。 更新:共识是有两条路在这里旅行: 使用像firebug这样的Firefox插件检查HTML,并注意jQuery应用于button的CSS类,并采取刺戳重写它们。 注意:在我的HTML中,两个button都使用了完全相同的CSS类,没有唯一的ID,所以这个选项已经不存在了。 […]

Android:对话框中的EditText不能拉起软键盘

所以我得到了什么似乎是一个常见的问题,这是我的对话框中的EditText不会显示时,它得到的焦点。 我已经看到了几个解决方法,比如在这个线程中 , 这个和这个 (还有更多),但是我从来没有看到一个令人满意的解释, 为什么这首先发生。 我更喜欢让android自己使用EditTexts的默认行为,而不是构build我自己的,但似乎每个人(在这些线程中)已经接受了对话框中的EditTexts的默认行为是只给一个游标,没有键盘。 为什么会这样? 对于logging,这些解决方法似乎没有任何工作对我来说 – 最近我已经能够迫使键盘出现在对话框下面 (使用InputMethodManager.toggleSoftKeyboard(*))。 我的特定configuration是API15,EditText显示在AlertDialog中的ListView的页脚上。 EditText android:focusable =“true”已设置,onFocusChangeListener 正在接收焦点事件。 编辑: 根据要求,这里是我正在使用的特定的代码片段。 我不打扰整个布局,但在这个特定的应用程序中,EditText出现在响应按下对话框上的button(类似于一个动作视图 )。 它包含在一个RelativeLayout中,默认情况下它的可见性已经“消失”了: <RelativeLayout android:id="@+id/relLay" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:visibility="gone" android:layout_marginTop="5dp" android:layout_marginBottom="5dp"> <ImageButton android:id="@+id/cancelBut" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:background="@color/transparent" android:src="@drawable/cancelButton" android:layout_margin="5dp"/> <ImageButton android:id="@+id/okBut" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/cancelBut" android:background="@color/transparent" android:src="@drawable/okButton" android:layout_margin="5dp" /> <EditText android:id="@+id/editText" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="text" android:focusable="true" android:layout_toLeftOf="@id/okBut"/> </RelativeLayout> […]

如何在对话框中保持沉浸模式?

当我的活动显示自定义对话框时,如何维护新的沉浸模式? 我使用这段代码来保持对话框中的沉浸模式,但是通过这个解决scheme,当我启动我的自定义对话框时,NavBar出现不到一秒钟,然后它就消失了。 这是一个video,更好地解释了这个问题(看看NavBar出现在屏幕的底部):http: //youtu.be/epnd5ghey8g 我如何避免这种行为? 码 我申请中所有活动的父亲: public abstract class ImmersiveActivity extends Activity { @SuppressLint("NewApi") private void disableImmersiveMode() { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_FULLSCREEN); } } @SuppressLint("NewApi") private void enableImmersiveMode() { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); } } /** * Set […]

Windows窗体中是否有内置确认对话框?

我想创build一个简单的确认对话框,说“请检查信息,如果您确定它是正确的,请单击确定。 有像这样内置的东西吗?

Android简单的警报对话框

我需要向用户显示一个小短信,在我的Android应用程序上点击一个button,在IOS上,我只需创build一个AlertView,使用起来很简单,但是由于解决scheme似乎比x10难多了,所以我很苦恼。 我看到我需要使用DialogFragment,但我不明白如何使它工作,可以解释一下吗? 另外,我的解决scheme是正确的,还是有更容易向用户显示简单的文本消息?

如何禁用/启用对话负面的正面button?

请看下面的自定义对话框。 我有对话框上的edittext字段,如果文本字段为空,我想禁用positiveButton 。 我可以得到一个charListener的文本字段,但我不知道我将如何设置positivebuttonbutton来禁用或启用该侦听器? 正面和负面button的参考是什么? case DIALOG_TEXT_ENTRY: // This example shows how to add a custom layout to an AlertDialog LayoutInflater factory = LayoutInflater.from(this); final View textEntryView = factory.inflate(R.layout.alert_dialog_text_entry, null); return new AlertDialog.Builder(AlertDialogSamples.this) .setIconAttribute(android.R.attr.alertDialogIcon) .setTitle(R.string.alert_dialog_text_entry) .setView(textEntryView) .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked OK so do some stuff […]

ProgressDialog中的“不确定”是什么意思?

也许我的英文很差,但是在这方面我实在搞不清楚“ 不确定 ”的含义: Android开发→ ProgressDialog.isIndeterminate()

如何在对话框中处理后退button?

我正在开发一个应用程序,按下button时,它会打开一个对话框,确定和取消button。 它工作正常。 当用户按下后退button时,我正在如下处理 public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK)) { } return super.onKeyDown(keyCode, event); } 但是上面的方法没有被调用。 我该如何处理?

在Windows窗体中提示对话框

我正在使用System.Windows.Forms但奇怪的是没有能力来创build它们。 我怎样才能得到像JavaScript提示对话框,没有JavaScript? MessageBox很好,但用户无法inputinput。