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

网站的网站建设公司哪家好如何制作公司app

网站的网站建设公司哪家好,如何制作公司app,北京想象力网站建设,广西网络推广公司哪家好弹窗是一种模态窗口#xff0c;通常用来展示用户当前需要的或用户必须关注的信息或操作。在弹出框消失之前#xff0c;用户无法操作其他界面内容。ArkUI 为我们提供了丰富的弹窗功能#xff0c;弹窗按照功能可以分为以下两类#xff1a; 确认类#xff1a;例如警告弹窗 Al… 弹窗是一种模态窗口通常用来展示用户当前需要的或用户必须关注的信息或操作。在弹出框消失之前用户无法操作其他界面内容。ArkUI 为我们提供了丰富的弹窗功能弹窗按照功能可以分为以下两类 确认类例如警告弹窗 AlertDialog。 选择类包括文本选择弹窗 TextPickerDialog 、日期滑动选择弹窗 DatePickerDialog、时间滑动选择弹窗 TimePickerDialog 等。 您可以根据业务场景选择不同类型的弹窗。 参考OpenHarmony 弹窗文档V4.0 今天我们主要了解一下自定义弹窗的使用 自定义弹窗 自定义弹窗的使用更加灵活适用于更多的业务场景在自定义弹窗中您可以自定义弹窗内容构建更加丰富的弹窗界面。自定义弹窗的界面可以通过装饰器CustomDialog 定义的组件来实现然后结合 CustomDialogController 来控制自定义弹窗的显示和隐藏。 1、定义自定义弹窗 CustomDialog struct CustomDialogExample {// 双向绑定传值Prop title: stringLink inputValue: string// 弹窗控制器控制打开/关闭必须传入且名称必须为controllercontroller: CustomDialogController// 弹窗中的按钮事件cancel: () voidconfirm: () void// 弹窗中的内容描述build() {Column() {Text(this.title || 是否修改文本框内容).fontSize(16).margin(24).textAlign(TextAlign.Start).width(100%)TextInput({ placeholder: 文本输入框, text: this.inputValue}).height(60).width(90%).onChange((value: string) {this.textValue value})Flex({ justifyContent: FlexAlign.SpaceAround }) {Button(取消).onClick(() {this.controller.close()this.cancel()}).backgroundColor(0xffffff).fontColor(Color.Black)Button(确定).onClick(() {this.controller.close()this.confirm()}).backgroundColor(0xffffff).fontColor(Color.Red)}.margin({ bottom: 10 })}} } 2、使用自定义弹窗 Entry Component struct Index {State title: string 标题State inputValue: string 文本框父子组件数据双绑// 定义自定义弹窗的Controller传入参数和回调函数dialogController: CustomDialogController new CustomDialogController({builder: CustomDialogExample({cancel: this.onCancel,confirm: this.onAccept,textValue: $textValue,inputValue: $inputValue}),cancel: this.existApp,autoCancel: true,alignment: DialogAlignment.Bottom,offset: { dx: 0, dy: -20 },gridCount: 4,customStyle: false})aboutToDisappear() {this.dialogController undefined // 将dialogController置空}onCancel() {console.info(点击取消按钮, this.inputValue)}onAccept() {console.info(点击确认按钮, this.inputValue)}build() {Column() {Button(打开自定义弹窗).width(60%).margin({top:320}).zIndex(999).onClick((){if (this.dialogController ! undefined) {this.dialogController.open()}})}.height(100%).width(100%) } 3、一个完整的示例常用网站选择 export interface HobbyBean {label: string;isChecked: boolean; }export type DataItemType { value: string }Extend(Button) function dialogButtonStyle() {.fontSize(16).fontColor(#007DFF).layoutWeight(1).backgroundColor(Color.White).width(500).height(40) }CustomDialog struct CustomDialogWidget {State hobbyBeans: HobbyBean[] [];Prop title:string;Prop hobbyResult: ArrayDataItemType;Link hobbies: string;private controller: CustomDialogController;setHobbiesValue(hobbyBeans: HobbyBean[]) {let hobbiesText: string ;hobbiesText hobbyBeans.filter((isCheckItem: HobbyBean) isCheckItem?.isChecked).map((checkedItem: HobbyBean) {return checkedItem.label;}).join(,);this.hobbies hobbiesText;}aboutToAppear() {// let context: Context getContext(this);// let manager context.resourceManager;// manager.getStringArrayValue($r(app.strarray.hobbies_data), (error, hobbyResult) {// });this.hobbyResult.forEach(item {const hobbyBean {label: item.value,isChecked: this.hobbies.includes(item.value)}this.hobbyBeans.push(hobbyBean);});}build() {Column() {Text(this.title || 兴趣爱好).fontWeight(FontWeight.Bold).alignSelf(ItemAlign.Start).margin({ left: 24, bottom: 12 })List() {ForEach(this.hobbyBeans, (itemHobby: HobbyBean) {ListItem() {Row() {Text(itemHobby.label).fontSize(16).fontColor(#182431).layoutWeight(1).textAlign(TextAlign.Start).fontWeight(500).margin({ left: 24 })Toggle({ type: ToggleType.Checkbox, isOn: itemHobby.isChecked }).margin({right: 24}).onChange((isCheck) {itemHobby.isChecked isCheck;})}}.height(36)}, itemHobby itemHobby.label)}.margin({top: 6,bottom: 8}).divider({strokeWidth: 0.5,color: #0D182431}).listDirection(Axis.Vertical).edgeEffect(EdgeEffect.None).width(100%)// .height(248)Row({space: 20}) {Button(关闭).dialogButtonStyle().onClick(() {this.controller.close();})Blank().backgroundColor(#F2F2F2).width(1).opacity(1).height(25)Button(保存).dialogButtonStyle().onClick(() {this.setHobbiesValue(this.hobbyBeans);this.controller.close();})}}.width(93.3%).padding({top: 14,bottom: 16}).borderRadius(32).backgroundColor(Color.White)} }Entry Component struct HomePage {State hobbies: string ;State hobbyResult: ArrayDataItemType [{value: FaceBook},{value: Google},{value: Instagram},{value: Twitter},{value: Linkedin}]private title: string 常用网站customDialogController: CustomDialogController new CustomDialogController({builder: CustomDialogWidget({hobbies: $hobbies,hobbyResult: this.hobbyResult,title: this.title}),alignment: DialogAlignment.Bottom,customStyle: true,offset: { dx: 0,dy: -20 }});build() {Column() {Button(打开自定义弹窗).width(60%).margin({top: 50}).zIndex(999).onClick((){if (this.customDialogController ! undefined) {this.customDialogController.open()}})Text(this.hobbies).fontSize(16).padding(24)}.width(100%)} } 参考https://gitee.com/harmonyos/codelabs/tree/master/MultipleDialog
http://www.zqtcl.cn/news/70120/

相关文章:

  • 中国在数码网站注册域名好>长春网站设计策划
  • ftp网站 免费某网站安全建设方案
  • 做网站推广我们是专业的windows 2003 iis wordpress
  • 商城的网站统计如何做电子商务营销师证书含金量
  • 巴中网站建设有限公司泉州自主建站模板
  • 网站发布到ftp国外设计网站app
  • 四川网站营销seo什么价格免费素材大全视频
  • 网站如何做点击链接苏州品牌网站设计企业
  • 福州百度网站快速优化iis做网站的流程
  • 北京网站模板建站网站前台设计模板
  • 网站目标规划什么网店可以免费开店
  • 专业网站优化哪家好从网络安全角度考量请写出建设一个大型电影网站规划方案
  • 有没有做试卷的网站论坛定制
  • 金融理财网站建设方案汉滨区城乡建设规划局 网站
  • 17网站一起做网店怎么拿货淄博网站建设找卓迅
  • 找公司做网站先付全款吗图片分享网站源码
  • 弹簧东莞网站建设建设厅网站注册后多长时间开通
  • 做医疗健康类网站需要资质吗阿里巴巴是搭建的网站吗
  • 网站建设论文3000字范文有哪些做的好的营销型网站
  • 十堰网站建设多少钱网站优化销售话术
  • wordpress微信站建设网站对服务器有什么要求吗
  • 百度竞价排名服务软件网站关键词优化
  • 宁波有做网站的地方吗wordpress rss采集
  • 教育培训网站建设在线设计平台的销售
  • 网站建设关键技术苏州有什么好玩的景点景区
  • 申请绿色网站建设网站的虚拟主机在哪里买
  • ico交易网站怎么做青岛seo
  • 关键词排名查询官网成品网站源码的优化技巧
  • 襄阳市作风建设年 网站2018做网站还是app
  • 百度不收录网站怎么办网站 多服务器