当前位置: 首页 > news >正文

怎样上传网站到百度免费咨询女性妇科问题

怎样上传网站到百度,免费咨询女性妇科问题,长春火车站进站需要核酸检测吗,成都关键词优化【高心星出品】 文章目录 全局自定义弹出框openCustomDialog案例开发步骤完整代码 全局自定义弹出框openCustomDialog CustomDialog是自定义弹出框#xff0c;可用于广告、中奖、警告、软件更新等与用户交互响应操作。开发者可以通过CustomDialogController类显示自定义弹出框…【高心星出品】 文章目录 全局自定义弹出框openCustomDialog案例开发步骤完整代码 全局自定义弹出框openCustomDialog CustomDialog是自定义弹出框可用于广告、中奖、警告、软件更新等与用户交互响应操作。开发者可以通过CustomDialogController类显示自定义弹出框。 但是使用起来有很多问题不支持动态创建也不支持动态刷新在相对较复杂的应用场景中推荐使用UIContext中获取到的PromptAction对象提供的openCustomDialog接口来实现自定义弹出框。 openCustomDialog传参为ComponentContent形式通过ComponentContent封装内容可以与UI界面解耦调用更加灵活可以满足开发者的封装诉求。拥有更强的灵活性弹出框样式是完全自定义的且在弹出框打开之后可以使用updateCustomDialog方法动态更新弹出框的一些参数。 案例 下面将写一个案例点击按钮弹出自定义对话框并且可以动态修改对话框的位置和内容。 运行结果 开发步骤 全局对话框弹出工具 里面只需要UIContextComponentContent和对话框配置option。 里面有打开对话框关闭对话框和更新对话框的方法。 class customdialogutil {// UI上下文环境private static uicontext: UIContextpublic static setuicontext(value: UIContext) {customdialogutil.uicontext value}// 对话框显示的内容private static content: ComponentContentObjectpublic static setcontent(value: ComponentContentobject) {customdialogutil.content value}// 弹出对话框的配置private static option: promptAction.ShowDialogOptionspublic static setoption(value: promptAction.ShowDialogOptions) {customdialogutil.option value}// 打开弹出框static open() {customdialogutil.uicontext.getPromptAction().openCustomDialog(customdialogutil.content, customdialogutil.option).catch((err: Error) {console.error(gxxt , err.message)})}// 关闭弹出框static close() {customdialogutil.uicontext.getPromptAction().closeCustomDialog(customdialogutil.content).catch((err: Error) {console.error(gxxt , err.message)})}// 更新弹出框内容或这样式static update(nopt: promptAction.ShowDialogOptions) {customdialogutil.uicontext.getPromptAction().updateCustomDialog(customdialogutil.content, nopt).catch((err: Error) {console.error(gxxt , err.message)})} }生成对话框界面的构建函数 interface param {message: stringupdck: () voidcloseck: () void }Builder function dialogcontent(p: param) {Column({ space: 20 }) {Text(p.message).fontSize(20).fontWeight(FontWeight.Bolder)Row() {Button(更新).onClick(p.updck)Button(关闭).onClick(p.closeck)}.justifyContent(FlexAlign.SpaceAround).width(100%)}.padding(20).backgroundColor(Color.White).width(80%).borderRadius(20) }页面代码 Entry Component struct CustomdialogPage {build() {Column() {Button(弹出框).width(60%).onClick(() {// 设置ui上下文环境customdialogutil.setuicontext(this.getUIContext())// 第一个builder构建函数生成的compoentcontentlet content: ComponentContentparam new ComponentContentparam(this.getUIContext(), wrapBuilder[param](dialogcontent), {message: 自定义对话框内容1, updck: () {// 更新对话框的位置customdialogutil.update({ alignment: DialogAlignment.Top, offset: { dy: 100, dx: 0 } })}, closeck: () {// 关闭对话框customdialogutil.close()}})// 设置第一个构建函数的componentcontentcustomdialogutil.setcontent(content)customdialogutil.setoption({})// 打开对话框customdialogutil.open()})}.height(100%).width(100%).justifyContent(FlexAlign.Center)} }完整代码 import { ComponentContent, promptAction, typeNode } from kit.ArkUIclass customdialogutil {// UI上下文环境private static uicontext: UIContextpublic static setuicontext(value: UIContext) {customdialogutil.uicontext value}// 对话框显示的内容private static content: ComponentContentObjectpublic static setcontent(value: ComponentContentobject) {customdialogutil.content value}// 弹出对话框的配置private static option: promptAction.ShowDialogOptionspublic static setoption(value: promptAction.ShowDialogOptions) {customdialogutil.option value}// 打开弹出框static open() {customdialogutil.uicontext.getPromptAction().openCustomDialog(customdialogutil.content, customdialogutil.option).catch((err: Error) {console.error(gxxt , err.message)})}// 关闭弹出框static close() {customdialogutil.uicontext.getPromptAction().closeCustomDialog(customdialogutil.content).catch((err: Error) {console.error(gxxt , err.message)})}// 更新弹出框内容或这样式static update(nopt: promptAction.ShowDialogOptions) {customdialogutil.uicontext.getPromptAction().updateCustomDialog(customdialogutil.content, nopt).catch((err: Error) {console.error(gxxt , err.message)})} }interface param {message: stringupdck: () voidcloseck: () void }Builder function dialogcontent(p: param) {Column({ space: 20 }) {Text(p.message).fontSize(20).fontWeight(FontWeight.Bolder)Row() {Button(更新).onClick(p.updck)Button(关闭).onClick(p.closeck)}.justifyContent(FlexAlign.SpaceAround).width(100%)}.padding(20).backgroundColor(Color.White).width(80%).borderRadius(20) }Entry Component struct CustomdialogPage {build() {Column() {Button(弹出框).width(60%).onClick(() {// 设置ui上下文环境customdialogutil.setuicontext(this.getUIContext())// 第一个builder构建函数生成的compoentcontentlet content: ComponentContentparam new ComponentContentparam(this.getUIContext(), wrapBuilder[param](dialogcontent), {message: 自定义对话框内容1, updck: () {// 更新对话框的位置customdialogutil.update({ alignment: DialogAlignment.Top, offset: { dy: 100, dx: 0 } })}, closeck: () {// 关闭对话框customdialogutil.close()}})// 设置第一个构建函数的componentcontentcustomdialogutil.setcontent(content)customdialogutil.setoption({})// 打开对话框customdialogutil.open()})}.height(100%).width(100%).justifyContent(FlexAlign.Center)} }customdialogutil.setcontent(content)customdialogutil.setoption({})// 打开对话框customdialogutil.open()})}.height(100%).width(100%).justifyContent(FlexAlign.Center)} }
http://www.hkea.cn/news/14391366/

相关文章:

  • 廊坊网站快速排名优化销量最高的wordpress模版
  • 网站开发需求分析中性能需求分析wordpress 链接 弹窗
  • dhl做单网站潮州移动网站建设
  • 行业网站开发费用icp网站 是什么意思
  • 手机怎么做网站免费的官方网站的域名
  • 网站建设哪个深圳建站模板公司
  • 网站 东莞长安Wordpress5主题破解版
  • 企业网站建设规划 论文8大营销工具
  • 无需下载的网站网站页脚的信息都有什么
  • 北京网站建设公司价格自己的网站怎么在百度上面推广
  • 如何制作网站二维码上海万户信息技术有限公司
  • 如何开个公司网站模具机械设备东莞网站建设
  • 网站建设找实体还是淘宝廊坊seo建站
  • wordpress建什么网站好wordpress记录访问量
  • 长沙高端网站建设公司高并发 wordpress
  • 中国铁道工程建设协会网站做轴承生意的网站
  • 网站外链建设周期wordpress修改页面标题显示
  • 河南建设168工程网官方网站最新永久4虎最新人口
  • 智能网站建设找三好科技进网站后台显示空白
  • 查竣工验收报告的网站平台页面设计模板
  • 个人可以做几个网站吗洛阳网站建设培训
  • 学校网站建设先进事迹长图可以在哪些网站做
  • 钓鱼网站查询系统wordpress 1.6.2漏洞
  • 广告公司网站建设费用wordpress 正在解压缩安装包
  • 网站设计广州量计价格在线建设网站 源代码
  • php做二手商城网站源码海南疾控发布问卷调查
  • 公司注册网站需要什么条件建筑工人找活正规平台
  • 专做正品的护肤品网站asp网站gzip压缩
  • discuz网站名称起名网站开发
  • 设计素材网站排行榜前十名展厅布局设计平面图