首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏HarmonyOS Next快速入门

    HarmonyOS Next快速入门:@CustomDialog自定义弹窗

    ##HarmonyOS Next快速入门##HarmonyOS应用开发##教育##CustomDialog是自定义弹窗,可用于广告、中奖、警告、软件更新等与用户交互响应操作。 自定义弹窗的界面可以通过装饰器@CustomDialog定义的组件来实现@CustomDialogexport struct WelcomeDialog { controller: CustomDialogController componnents/WelcomeDialog';@Entry@Componentstruct CustomDialogPage { @State message: string = '第2节 @CustomDialog

    23600编辑于 2025-07-04
  • 来自专栏鸿蒙开发笔记

    HarmonyOS 开发实践——自定义弹框使用(CustomDialog+TextPicker组合)

    那么本文就来分享一个实际应用中比较常用的自定义弹框组合,即结合CustomDialog和TextPicker组件在HarmonyOS中实现一个自定义弹框的使用案例,方便大家学习和使用。 其他六种弹窗是系统预定义的弹框,而剩下的CustomDialog弹窗是允许开发者自定义弹窗的布局和内容的。 1、CustomDialog弹窗由于本文主要是分享关于CustomDialog弹窗的,所以这里只单独详细介绍CustomDialog弹窗,其他弹窗内容这里不再过多介绍,大家可以自行去鸿蒙官网查阅。 这就需要使用CustomDialog来创建一个自定义的内容选择弹框,并在其中嵌入TextPicker组件来实现自定义内容选择功能。2. 具体实现由于篇幅原因,这里直接把自定义的CustomDialog+TextPicker组合弹框文件分享出来,然后再分享一下具体调用自定义弹窗的使用部分。

    89320编辑于 2024-10-29
  • 来自专栏HarmonyOS知识集合

    【HarmonyOS Next】鸿蒙中自定义弹框OpenCustomDialog、CustomDialog与DialogHub的区别详解

    【HarmonyOS Next】鸿蒙中自定义弹框OpenCustomDialog、CustomDialog与DialogHub的区别详解一、三者的区别与关系1. 官方迭代过程为:CustomDialog = 》 OpenCustomDialog = 》 DialogHub迭代过程表明,弹框的调用越来越便捷,与UI解耦,最终达到在纯逻辑中使用自定义弹出,弹框内容更新和生命周期可控 2.CustomDialog的用法: 首先需要创建@CustomDialog装饰的自定义弹框布局,CustomDialogController来实现弹窗弹出和关闭。 3.OpenCustomDialog 的用法: 对标CustomDialog 的CustomDialogController。 将@CustomDialog弹框布局内容,放到ComponentContent节点对象中,实现弹框UI的解耦。

    70510编辑于 2025-03-28
  • 来自专栏历史专栏

    【愚公系列】2023年12月 HarmonyOS教学课程 020-ArkUI组件(CustomDialog

    一、CustomDialog CustomDialog组件是一种自定义对话框,可以通过开发人员根据特定的要求定制内容和布局。 CustomDialog通常用于在执行任务之前向用户提供额外的信息或输入选项,例如确认删除操作或输入登录凭据。它们还可以用于创建弹出窗口来显示信息或广告。 CustomDialog通常涉及创建一个新的布局文件,并扩展Dialog类来自定义其行为和外观。 1.创建自定义弹窗 HarmonyOS的@CustomDialog是一个自定义对话框控件,它可以帮助开发人员快速创建各种各样的对话框,包括提示框、确认框、输入框等。 使用@CustomDialog,开发人员可以自定义对话框的标题、消息、按钮、图标等属性,以及对话框的样式和布局。此外,它还支持自定义对话框的背景、动画和触发事件等属性,以满足不同场景的需求。

    16700编辑于 2025-06-02
  • 来自专栏日常活动篇

    Qt5实战第四篇:Qt5的对话框与窗口

    // CustomDialog.h#ifndef CUSTOMDIALOG_H#define CUSTOMDIALOG_H #include <QDialog> class CustomDialog : public QDialog{ Q_OBJECT public: explicit CustomDialog(QWidget *parent = nullptr); private slots (e.g., QLineEdit *lineEdit; QLabel *label; etc.)}; #endif // CUSTOMDIALOG_H // CustomDialog.cpp#include "CustomDialog.h"#include <QVBoxLayout>#include <QLineEdit>#include <QLabel>#include <QPushButton> CustomDialog ::CustomDialog(QWidget *parent) : QDialog(parent){ // Set up the dialog's layout and widgets

    1.1K10编辑于 2024-12-27
  • 来自专栏cwl_Java

    速读原著-Android应用开发入门教程(样式的设置)

    参考示例程序CustomDialogActivity(ApiDemo=>App=>Activity=>CustomDialog) 源代码:com/example/android/apis/app/CustomDialogActivity.java app.CustomDialogActivity" android:label="@string/activity_custom_dialog" android:theme="@style/Theme.CustomDialog 这个程序和上一个程序基本相同,区别在于样式被设置成了 CustomDialogCustomDialog 是一个自定义样式,在 styles.xml 中进行定义,如下所示: <style name="Theme.<em>CustomDialog</em> :style/Theme.Dialog"> <item name="android:windowBackground">@drawable/filled_box</item> </style> CustomDialog

    75910发布于 2020-02-13
  • 来自专栏伟大程序猿的诞生

    安卓自定义Dialog的实现

    true</item> <item name="android:windowIsFloating">true</item> </style> 三、MainActivity代码 CustomDialog.Builder builder = new CustomDialog.Builder(MainActivity.this); builder.setMessage("这个就是自定义的提示框 extends Dialog { public CustomDialog(Context context) { super(context); } public CustomDialog(Context context, int theme) { super(context, theme); } public static class this.negativeButtonClickListener = listener; return this; } public CustomDialog

    1.3K30发布于 2019-01-21
  • 来自专栏全栈程序员必看

    adnroid仿miui的dialog

    所以这次尝试还是使用dialog来做 ,非常多地方是引用了系统源代码(源代码是最好的老师) 首先看CustomDialog.java的构造函数: protected CustomDialog(Context context) { this(context, R.style.CustomDialog); } protected CustomDialog(Context context

    1K10编辑于 2022-07-13
  • 来自专栏个人路线

    鸿蒙 dialog各种用法教程【鸿蒙专题3】

    * 类说明 自定义dialog * * */ public class CustomDialog extends CommonDialog { private static final String customDialog = new CustomDialog(this); customDialog.setTitle("这是一个自定义弹窗"); customDialog.setAutoClosable (true); customDialog.setOnConfirmListener(string -> { resultText.setText(string); customDialog.destroy(); }); customDialog.show(); 自定义dialog 属性就看我们的自己封装了 ,我们可以在 CustomDialog类中完成 这样我们的调用代码就相对简洁 。

    96320编辑于 2021-12-10
  • 来自专栏风吹杨柳

    2014-10-31Android学习------在小窗口Dialog中实现GIF动画--------GIF动画实现

    method stub super.onCreate(savedInstanceState); //setContentView(new CustomGifView(this)); Dialog customDialog = new Dialog(this); customDialog.setTitle("GIF"); customDialog.setContentView(new CustomGifView(this )); customDialog.show(); } class CustomGifView extends View { public CustomGifView(Context

    94830编辑于 2022-03-07
  • 来自专栏老欧说安卓

    鸿蒙NEXT版仿微信聊天App的自定义弹窗

    要想在对话框中输入文字,就得自己定义基于CustomDialog的对话框,把编辑框塞到弹窗中。 下面详细介绍如何使用CustomDialog组件实现自定义的输入弹窗。 自定义对话框以“@CustomDialog”前缀开头,并且内部必须声明CustomDialogController类型的控制器属性,这样外部页面才能通过控制器对象操纵对话框的交互动作。 比如下面代码就定义了一个自定义对话框的框架代码: @CustomDialog export struct CustomInputDialog { @State nickName: string = ''; // @CustomDialog组件必须声明CustomDialogController属性 dialogController?

    82610编辑于 2024-11-25
  • 来自专栏Android、鸿蒙开发

    Android 自定义加载动画Dialog弹窗

    import android.widget.ImageView; import android.widget.TextView; /** * 自定义弹窗 - Java */ public class CustomDialog extends Dialog { TextView tvLoadingTx; ImageView ivLoading; public CustomDialog(Context context) { this(context, R.style.loading_dialog, "玩命加载中..."); } public CustomDialog context, String string) { this(context, R.style.loading_dialog, string); } protected CustomDialog android.view.animation.AnimationUtils import android.widget.ImageView import android.widget.TextView /** * 自定义弹窗 - Kotlin */ class CustomDialog

    4.2K30发布于 2020-09-25
  • 来自专栏Android必知必会

    Android 必知必会 - DialogFragment 使用总结

    // 设置主题的构造方法 // AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.CustomDialog // 设置主题的构造方法 // AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.CustomDialog new Dialog(getActivity()); // 设置主题的构造方法 // Dialog dialog = new Dialog(getActivity(), R.style.CustomDialog inflater.inflate(R.layout.fragment_dialog, null); Dialog dialog = new Dialog(getActivity(), R.style.CustomDialog inflater.inflate(R.layout.fragment_dialog, null); Dialog dialog = new Dialog(getActivity(), R.style.CustomDialog

    4.8K31发布于 2019-07-01
  • 来自专栏Android先生

    项目需求讨论-Android 自定义Dialog实现步骤及封装

    Android Studio插件来快速自动生成代码,大家可以来看下我已经写得文章:经典Builder/变种Builder模式及自动化生成代码插件) 我先上代码再来进行查看: public class CustomDialog = -1) { return new CustomDialog(this, resStyle); } else { return new CustomDialog(this); } } } } 我这边的Builder中对height和width写了三种方式,比如直接写入 然后我们再来写上面的ErrorDialog: CustomDialog.Builder builder = new CustomDialog.Builder(this); dialog = builder.cancelTouchout builder = new CustomDialog.Builder(this); CustomDialog dialog = builder .style(R.style.Dialog

    1.7K31发布于 2018-08-07
  • 来自专栏青蛙要fly的专栏

    项目需求讨论 - Android 自定义 Dialog 实现步骤及封装

    Android Studio插件来快速自动生成代码,大家可以来看下我已经写得文章:经典Builder/变种Builder模式及自动化生成代码插件) 我先上代码再来进行查看: public class CustomDialog = -1) { return new CustomDialog(this, resStyle); } else { return new CustomDialog(this); } } } } 我这边的Builder中对height和width写了三种方式,比如直接写入 然后我们再来写上面的ErrorDialog: CustomDialog.Builder builder = new CustomDialog.Builder(this); dialog = builder.cancelTouchout builder = new CustomDialog.Builder(this); CustomDialog dialog = builder .style(R.style.Dialog

    1.6K10编辑于 2024-02-01
  • 来自专栏iOS小生活

    Flutter 中的Dialog

    代码如下: //自定义Dialog import 'package:flutter/material.dart'; //自定义Dialog,必须继承自Dialog class CustomDialog extends Dialog { final String title; final String content; CustomDialog({this.title = "", this.content Dialog _showCustomDialog(){ showDialog( context: context, builder: (context){ return CustomDialog Dialog import 'dart:async'; import 'package:flutter/material.dart'; //自定义Dialog,必须继承自Dialog class CustomDialog Dialog _showCustomDialog(){ showDialog( context: context, builder: (context){ return CustomDialog

    5.1K30发布于 2019-09-04
  • 来自专栏鸿蒙开发笔记

    HarmonyOS 开发实践 —— 基于webview拉起自定义键盘

    方案描述通过注册一个js代理对象被web的registerJavaScriptProxy方法调用拉起CustomDialog,在CustomDialog上放置一个customkeyboard场景一:通过 效果图方案通过注册一个js代理对象被web的registJavaScriptProxy方法调用拉起CustomDialog,在CustomDialog上放置一个自定义键盘组件,通过在H5上input标签的

    40710编辑于 2024-12-20
  • 来自专栏HarmonyOS Next

    HarmonyOS Next中的弹出框使用

    主要包括基础自定义弹出框 (CustomDialog)、不依赖UI组件的自定义弹出框 (openCustomDialog)。 本文主要是介绍自定义弹出框的使用,固定样式弹出框可以参考官方文档,自定义弹出框主要有两种实现方式:1、基础自定义弹出框 (CustomDialog)(不推荐)2、不依赖UI组件的全局自定义弹出框 (openCustomDialog )(推荐)基础自定义弹出框 (CustomDialog)CustomDialog是自定义弹出框,可用于广告、中奖、警告、软件更新等与用户交互响应操作。 1、@CustomDialog装饰器使用@CustomDialog装饰器装饰自定义弹出框,可在此装饰器内自定义弹出框内容。这里在装饰器内添加确定和取消按钮,也可以同时添加数据函数。 和@CustomDialog装饰器一样,CustomContentDialog也可以添加按钮和数据,如果需要完全自定义弹框样式,可以只设置contentBuilder函数参数用来实现自定义弹框。

    56200编辑于 2025-03-19
  • 来自专栏编程路

    横扫鸿蒙弹窗乱象,SmartDialog出世

    前言 但凡用过鸿蒙原生弹窗的小伙伴,就能体会到它们是有多么的难用和奇葩,什么AlertDialog,CustomDialog,SubWindow,bindXxx,只要大家用心去体验,就能发现他们有很多离谱的设计和限制 单单一个使用方式而言,就是吊打鸿蒙的CustomDialogCustomDialog的各种限制和使用方式,我不想再去提及和吐槽了 有时候,简洁的使用,才是最大的魅力 鸿蒙版的SmartDialog有什么优势 SmartDialog.config.attach.attachAlignmentType = SmartAttachAlignmentType.center } 检查弹窗是否存在 // 检查当前是否有CustomDialog loading 样式 SmartDialog.showLoading() // 支持入参,可以在特殊场景下灵活配置 SSmartDialog.showLoading({ builderArgs: 1 }) CustomDialog

    69610编辑于 2024-09-28
  • 来自专栏CSDN博客

    鸿蒙应用开发-自定义可删除列表弹窗

    功能介绍: 自定义列表弹窗,可以对弹窗的列表点击删除,参考文档创建列表,自定义弹窗文档自定义弹窗(CustomDialog)。 知识点: 熟悉对List控件的使用。 this.notifyDataDelete(index); } public reloadData(): void { this.notifyDataReload(); } } src/main/ets/view/CustomDialog.ets /model/IntentionDataSource' @CustomDialog export struct AddIntentionDialog { private controller: CustomDialogController /view/CustomDialog' import { Intention } from '..

    38900编辑于 2024-05-26
领券