鸿蒙开发 组件:菜单(Menu)

HarmonyOS NEXT实战开发:构建弹窗 通过弹窗控制器显示自定义弹窗,可以设置自定义弹窗的样式和内容。 阅读详情
往期推文全新看点(文中附带最新·鸿蒙全栈学习笔记)

1.嵌入式开发适不适合做鸿蒙南向开发?一文带你了解

2.鸿蒙众多岗位需求突增!该如何选择?

3.分享一场鸿蒙开发岗位面试经历~

4.待更新中……

Menu是菜单接口,一般用于鼠标右键弹窗、点击弹窗等。具体用法请参考 菜单控制 。

创建默认样式的菜单

菜单需要调用bindMenu接口来实现。bindMenu响应绑定组件的点击事件,绑定组件后手势点击对应组件后即可弹出。

Button('click for Menu')
  .bindMenu([
    {
      value: 'Menu1',
      action: () => {
        console.info('handle Menu1 select')
      }
    }
  ])
HarmonyOS Next开发学习手册——BuilderNode BuilderNode 提供能够挂载原生组件的能力,支持通过无状态的UI方法 全局@Builder 生成组件树,并通过 getFrameNode 获取组件树的根 FrameNode 节点。该节点可以通过 NodeController 直接返回,挂载在 NodeContainer 节点下,也可以在FrameNode树结构和 RenderNode 树结构嵌入声明式的组件结构,实现混合显示的能力。同时BuilderNode可以提供纹理导出的功能,导出的纹理用于在 XComponent 中进行同层渲染显示。 阅读详情

相关推荐

【鸿蒙实战开发】HarmonyOS开发添加菜单(Menu)组件

Menu是菜单接口,一般用于鼠标右键弹窗、点击弹窗等。具体用法请参考Menu控制。

HarmonyOS007的博客 582

鸿蒙开发基础 —— ArkUI 组件:菜单(Menu)

当默认样式不满足开发需求时,可使用 @Builder 自定义菜单内容,通过bindMenu接口进行菜单的自定义。

guangxishaoji的博客 440

鸿蒙开发——UI系统组件之菜单(Menu)

当默认样式不满足开发需求时,可使用@Builder自定义菜单内容。可通过bindMenu接口进行菜单的自定义。step1: @Builder开发菜单内的内容@BuilderMenu() {MenuItem({ content: "复制", labelInfo: "Ctrl+C" })MenuItem({ content: "粘贴", labelInfo: "Ctrl+V" })@BuilderMyMenu(){Menu() {

duoduola666的博客 341

【鸿蒙实战开发】菜单组件(menu)开发指导

提供菜单组件,作为临时性弹出窗口,用于展示用户可执行的操作,具体用法请参考menu。

HarmonyOS007的博客 951

鸿蒙5.0开发进阶:UI组件-菜单(Menu)

Menu是菜单接口,一般用于鼠标右键弹窗、点击弹窗等。

m0_69424697的博客 657

鸿蒙5.0版开发:ArkTS组件-Menu

以垂直列表形式显示的菜单。

m0_69424697的博客 847

鸿蒙界面开发——组件(5):菜单Menu & 绑定菜单

不支持作为普通组件单独使用。Menu 以垂直列表形式显示的菜单。包含MenuItem、MenuItemGroup子组件。布局过程中,期望每个菜单项的宽度一致。若子组件设置了宽度,则以尺寸计算规则为准。不设置宽度的情况:菜单组件会对子组件MenuItem、MenuItemGroup设置默认2栅格的宽度,若菜单项内容区比2栅格宽,则会自适应撑开。设置宽度的情况:菜单组件会对子组件MenuItem、MenuItemGroup设置减去padding后的固定宽度。

littleyy666的博客 1452

Kubernetes CRD 系列(一):CRD 介绍

CR(Custom Resource)其实就是在 Kubernetes 中定义一个自己的资源类型,是一个具体的 “自定义 API 资源” 实例,为了能够让 Kubernetes 认识这个 CR,就需要让 Kubernetes 明白这个 CR 的宏观定义是什么,也就是需要创建所谓的 CRD(Custom Resource Definition)来表述。 可能这么说并不是太直观,换个方式表达一下,我们想要创建一个 Pod 的时候,那么会编写一个 YAML 配置,然后前两行一般会这么写: [root@l

会哭的雨@的博客 7920

深入解析LVDS电平标准在LCD屏接口设计中的关键作用

本文深入解析了LVDS电平标准在LCD屏接口设计中的核心作用。文章不仅阐释了LVDS低电压差分信号的工作原理、关键电气参数及抗噪优势,还详细对比了VESA与JEIDA两种主流数据格式,并提供了从PCB布局布线到信号调试的实战避坑指南,是确保高速、稳定显示的关键技术参考。

weixin_28419039的博客 334

零基础也能懂的Arduino ESP32离线安装包图文教程

手把手教你完成Arduino ESP32离线安装包的配置,无需联网也能快速搭建开发环境,适合初学者和网络受限用户,轻松实现arduino esp32离线安装包部署。

weixin_36213081的博客 2673

QMT实盘交易入门:5分钟搞定ETF全球配置策略(附完整代码)

本文详细介绍了如何使用QMT平台实现ETF全球配置策略,从环境准备到策略编写、实盘部署全流程仅需5分钟。通过xtquant库对接交易所接口,提供完整的动量轮动策略代码,帮助投资者快速掌握自动交易技术,优化全球资产配置。

weixin_30675247的博客 334

【全部更新】2025金地杯E题山西省大学生数学建模思路代码文章教学:高速铁路牵引供电系统能耗优化

问题四将列车的运行速度与发车时间同时作为优化变量,建立联合优化模型,目标是在考虑电价机制和调度均衡性的前提下,使牵引供电系统一天内的总电费支出最小。问题三在考虑分时电价机制的基础上,基于遗传算法优化列车速度组合,使牵引供电系统一天内的总电费支出最小。然而,在实际运营中,不同时段的电价差异显著,合理安排列车的运行时间与运行速度,可有效降低系统的总电费支出。本研究聚焦于高速铁路牵引供电系统的能耗与电费优化问题,针对列车运行速度、发车时间与分时电价的综合影响,提出一系列数学模型,以实现系统能耗与电费的最小化。

xb459149247的博客 5289

AI for Science:GNN预测分子性质全流程详解与工业实践

从分子表示到工业落地,一文掌握图神经网络在药物研发与材料设计中的核心实战近年来,的浪潮正深刻变革着传统科研范式。在药物研发与材料设计领域,作为核心环节,已从传统的实验试错转向基于图神经网络(GNN)的智能计算。本文将深入解析GNN预测分子性质的,涵盖数据准备、模型设计、训练优化到工业部署,并揭秘前沿技术与实战案例。

datacanvas2426的博客 1674

【人工智能】Gemini怎么使用智能体的能力? Gemini Gems: 定制你的AI智能体

Gems 是 Gemini 的定制版本。你可以通过设定特定的指令(Instructions),让它变成你需要的专家。一旦创建,它会记住这些设定,你不需要在每次对话时重复输入背景信息。目前创建和使用自定义 Gems 通常需要订阅(Google One AI Premium 计划)。对于大多数用户来说,Gemini Advanced 中的 Gems是使用智能体能力的最直接方式。它能让你把重复性的提示词封装成一个好用的工具。

奶爸的编程之路,也就一周冷个三天 780

EPLAN 电气制图(六):结构盒与设备管理器核心概念(基础知识选看)

结构盒是 EPLAN 中用于标识元件安装位置的逻辑容器,非实际设备或黑盒,仅用于原理图中划分功能区域或物理位置(如 “柜内”“柜外”)。标识符设置:在 “显示设备标识符” 中输入位置代号(如 “+ 柜外”),完整格式为 “= 高层代号 + 位置代号”;筛选与定位:通过 “筛选器” 按类别(如电机、接触器)快速查找设备,右键 “转到(图形)” 可高亮定位图纸中的元件;设备保护:重要设备可启用保护(【项目数据】→【设备】→【启用设备保护】),防止误删除(显示橙色圆圈标记)。

电工 1057

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

上一篇: 鸿蒙开发 气泡提示 (Popup)
下一篇: 鸿蒙开发 FA模型开发:PageAbility组件
普通网友
博客等级 码龄2年 826粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值