首页 > 其他分享 >自定义可编辑的对话框

自定义可编辑的对话框

时间:2023-06-20 18:05:22浏览次数:34  
标签:findViewById Dialog 自定义 对话框 text yourButton 编辑 dialog id

Dialog dialog = new Dialog(this); 
dialog.setContentView(R.layout.your_dialog_file); 
 
Button yourButton = dialog.findViewById(R.id.yourButton); 
final EditText text = dialog.findViewById(R.id.yourTextEdit); 
yourButton.setOnClickListener( { 
 
public void onClick(View view) { 
   if ( ! (text.getText().toString.equals(""))) { 
        //go on here and dismiss dialog 
   } 
 
});

标签:findViewById,Dialog,自定义,对话框,text,yourButton,编辑,dialog,id
From: https://blog.51cto.com/u_16166892/6524007

相关文章

  • 5步带你玩转SpringBoot自定义自动配置那些知识点
    目前SpringBoot框架真的深受广大开发者喜爱,毕竟它最大的特点就是:快速构建基于Spring的应用程序的框架,而且它提供了各种默认的功能和配置,可以让开发者快速搭建应用程序的基础结构。但是,当我们需要自定义一些配置时,我们就需要使用自定义自动配置。今天一定让大家深刻体验干货知识点......
  • Web编辑器从word复制粘贴图片
    ​图片的复制无非有两种方法,一种是图片直接上传到服务器,另外一种转换成二进制流的base64码目前限chrome浏览器使用首先以um-editor的二进制流保存为例:打开umeditor.js,找到UM.plugins['autoupload'],然后找到autoUploadHandler方法,注释掉其中的代码。加入下面的代码://判断剪贴......
  • 从0到1构造自定义限流组件
    一背景在系统高可用设计中,接口限流是一个非常重要环节,一方面是出于对自身服务器资源的保护,另一方面也是对依赖资源的一种保护措施。比如对于Web应用,我限制单机只能处理每秒1000次的请求,超过的部分直接返回错误给客户端。虽然这种做法损害了用户的使用体验,但是它是在极端并发......
  • 控制dialog对话框的大小
    publicclassSharePostextendsDialog{@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.adaptor_contentsharepost);LayoutParamsparams=getWindow().getAt......
  • TableRow 背景问题以及修改对话框标题高度或者图片
    <TableRowxmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/admin_row"android:layout_width="fill_parent"android:layout_height="wrap_content"......
  • HTML编辑器从word复制粘贴图片
    ​ 这种方法是servlet,编写好在web.xml里配置servlet-class和servlet-mapping即可使用后台(服务端)java服务代码:(上传至ROOT/lqxcPics文件夹下)<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%@     page contentType="text/html;cha......
  • vue鼠标拖拽自定义指令实现过程和原理分析
    在Vue中,可以使用自定义指令来实现鼠标拖拽的功能。自定义指令允许我们在DOM元素上绑定特定的行为和逻辑。以下是一个实现鼠标拖拽的自定义指令的例子,同时也包含了相应的原理分析:<template><divv-draggable>DragMe!</div></template><script>exportdefault{directives......
  • 自定义机会排序
    publicclassSortTest{privatestaticfinalList<String>technologyOrder=newArrayList<>();privatestaticfinalList<Student>students=newArrayList<>();static{technologyOrder.add("DDD");......
  • vue项目中使用vue-quill-editor富文本编辑器、支持大小和拖拉;以及 vue 引入quill - im
    在本内容的最后面附上了demo代码1.实现的效果图2.首先需要先引入依赖如果引入了下面这两个依赖报错的话,那么请查看当前内容的第8点,哪里有解决这个报错的方案npminstallquill-image-resize-modulenpminstallquill-image-drop-modulenpminstallvue-qui......
  • 算法题总结-字符串编辑距离
    原题https://www.nowcoder.com/practice/3959837097c7413a961a135d7104c314?tpId=37&tqId=21275&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3Fdifficulty%3D3%26page%3D1%26pageSize%3D50%26search%3D%26tpId%3D37%26type%3D37&am......