dialog

How to set Custom Dialog background dim?

痞子三分冷 提交于 2020-03-25 18:00:31
问题 I made custom dialog and it doesn't make background color dim. I tried this code and it shows with black background. dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); Also tried this, but it shows same result. Background is still black. window.setDimAmount(0.5f); This is my CustomDialog layout Code <?xml version="1.0" encoding="utf-8"?> <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android

去除alert弹窗域名

限于喜欢 提交于 2020-03-17 07:59:44
去除alert弹窗域名 在JS中调用浏览器的alert弹窗,会出现域名信息,显得不美观,现在利用JS将alert方法重写,这里提供两种写法: 1、 去除移动端alert的域名 ,代码直接调用即可; ( function ( ) { window . alert = function ( name ) { var iframe = document . createElement ( "IFRAME" ) ; iframe . style . display = "none" ; iframe . setAttribute ( "src" , 'data:text/plain' ) ; document . documentElement . appendChild ( iframe ) ; window . frames [ 0 ] . window . alert ( name ) ; iframe . parentNode . removeChild ( iframe ) ; } } ) ( ) ; 2、移动端与pc端都奏效,重写alert方法,代码直接调用即可 window . alert = function ( msg , callback ) { var div = document . createElement ( "div" ) ; div . innerHTML

Android之复选框对话框

只愿长相守 提交于 2020-03-16 09:17:28
main.xml布局文件 <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:text="" android:id="@+id/editText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:editable="false" android:cursorVisible="false" /> <Button android:text="显示复选框对话框" android:id="@+id/button" android:layout_width="fill_parent" android:layout_height="wrap_content" /></LinearLayout> array.xml数组 <?xml version="1.0" encoding=

android常用对话框封装

こ雲淡風輕ζ 提交于 2020-03-16 09:17:16
在android开发中,经常会用到对话框跟用户进行交互,方便用户可操作性;接下来就对常用对话框进行简单封装,避免在项目中出现冗余代码,加重后期项目的维护量;代码如有问题欢迎大家拍砖指正一起进步。 先贴出演示结果,在晒出演示代码。 1、运行成功后,原始界面如下: 2、点击“显示普通对话框”,效果界面如下: 3、点击“显示列表对话框”,效果界面如下: 4、点击“显示单选按钮对话框”,效果界面如下: 5、点击“显示复选对话框”,效果界面如下: 代码: 1、项目目录结构如下 2、对话框封装类DialogTool package com.hrtx.util; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface.OnClickListener; /** * 对话框封装类 * * @author jiqinlin * */ public class DialogTool { /** * 创建普通对话框 * * @param ctx 上下文 必填 * @param iconId 图标,如:R.drawable.icon 必填 * @param title 标题 必填 * @param message 显示内容 必填 * @param btnName

JavaFX create alert and get result

主宰稳场 提交于 2020-03-16 07:42:32
问题 For my CS class they require us to use JavaFX alerts. I can make an alert appear, but how do I get what button was clicked? What would be the best way to go about getting this data? Also if possible, I'd like to make it have a drop down panel and when the user selects and option the alert closes and prints what the user selected. Here's some example code that I have. When I click one of the buttons, it just closes the dialog. Alert a = new Alert(AlertType.NONE, "Promote pawn to:", new

bootstrap 模态框动态加载数据

核能气质少年 提交于 2020-03-11 15:05:24
1.页面中添加modal <!-- 模态框(Modal) --> <div class="modal fade" id="showModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog" style="width:900px;"> <div class="modal-content"> //内容动态填充 </div><!-- /.modal-content --> </div><!-- /.modal --> </div> 2.数据格式。页面动态生成a 标签 <a data-toggle='modal' data-target='#showModal' onclick=targetto('" + row.id + "')>"+ row.title+"</a>"; 3.单击事件 function targetto(id){ $("#showModal").modal({ remote: "showAction.action?id="+id }); } 4.每次隐藏时,清除数据。确保点击时,重新加载 $("#showModal").on("hidden.bs.modal", function() { $(this)

Bootstrap之BootstrapDialog

那年仲夏 提交于 2020-03-11 14:52:49
Make use of Bootstrap's modal more monkey-friendly. 参考地址: http://nakupanda.github.io/bootstrap3-dialog/ 模态弹框: <div class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Modal title</h4> </div> <div class="modal-body"> <p>One fine body…</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div><!--

Qt标准输入框

北战南征 提交于 2020-03-08 00:57:16
//inputdlg.h #ifndef INPUTDLG_H #define INPUTDLG_H #include <QDialog> #include <QLabel> #include <QPushButton> #include <QGridLayout> #include <QDialog> class InputDlg : public QDialog { Q_OBJECT public: InputDlg(QWidget *parent = 0); ~InputDlg(); private slots: void ChangeName(); void ChangeSex(); void ChangeAge(); void ChangeScore(); private: QLabel *nameLabel1; QLabel *sexLabel1; QLabel *ageLabel1; QLabel *scoreLabel1; QLabel *nameLabel2; QLabel *sexLabel2; QLabel *ageLabel2; QLabel *scoreLabel2; QPushButton *nameBtn; QPushButton *sexBtn; QPushButton *ageBtn; QPushButton *scoreBtn;

android 系统dialog的应用

时光总嘲笑我的痴心妄想 提交于 2020-03-07 06:12:15
应用示例如下: /* * 提示类型dialog */ private void dialog1(){ AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("test"); builder.setMessage("Is it exit?"); //设置内容 builder.setIcon(R.mipmap.ic_launcher);//设置图标 builder.setPositiveButton("ok", new DialogInterface.OnClickListener() { //which:点击ok,which是-1 //点击cancel,which是-3 //点击ignore,which是-2 @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } });

基于element封装下 弹窗

这一生的挚爱 提交于 2020-03-06 11:00:54
基础层:dialog <!-- 自定义弹窗模板 --> <template> <el-dialog v-bind="$attrs" :close-on-click-modal="$attrs['close-on-click-modal'] ? $attrs['close-on-click-modal'] : false" :close-on-press-escape="$attrs['close-on-press-escape'] ? $attrs['close-on-press-escape'] : false" v-on="$listeners" > <!-- <slot name="dialog" /> --> <slot name="body" /> <template slot="footer"> <slot name="footer" /> </template> </el-dialog> </template> <script> export default { name: "dialog", mounted() { //初始化title,防止冲突 this.$el.title=""; }, }; </script> <style lang='scss' scoped> .flexFooter{ display: flex; justify-content: flex