当前位置:网站首页>【Harmony OS】【FAQ】Hongmeng Questions Collection 1
【Harmony OS】【FAQ】Hongmeng Questions Collection 1
2022-08-03 04:32:00 【Huawei Developer Forum】
1. [ArkUI] Display Toast in eTS mode
import prompt from '@system.prompt'@[email protected] Index {build() {Column() {Row() {Button("Hello Button").fontColor(Color.White).fontSize(20).padding(20).onClick(() => {prompt.showToast({message: 'Hello,I am Toast',duration: 2000,bottom: 200})})}}.backgroundColor(Color.Black).width('100%').height('100%')}}
Show effect:
2. [DevEco Device Tool] cannot find the corresponding download link for the tool
The HarmonyOS official website cannot find the corresponding download link for the DevEco Device Tool
1. The current tool is temporarily offline and optimized. It is expected that the 3.0Beta2 version will be launched on December 30 (Thursday)
2. You can log in to this link through your account, and the DP platform-integrated development tab can be downloaded
3. [Java UI] How to debug the Hongmeng app to run to the real machine
To run the debugging application on the real machine, you need to obtain the udid first, and then add the device information in the AGC console.
The command line to get the UDID is as follows:
adb shell bm get -u
You can refer to the official website application debugging guide: Document Center
Guidelines for compiling and generating hap packages: Documentation Center
4. When developing [ArkUI]ets, how to set the minimum width or maximum width of components?
You can refer to the following API methods to set the maximum and minimum widths:
/*** constraint Size:* minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height,* @since 7*/constraintSize(value: {minWidth?: number | string | Resource;maxWidth?: number | string | Resource;minHeight?: number | string | Resource;maxHeight?: number | string | Resource;}): T;
The following is the ets code:
@[email protected] Second {build() {Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {Text('Hello World').fontSize(50).fontWeight(FontWeight.Bold).constraintSize({minWidth: 100,maxWidth: 200,minHeight: 100,maxHeight: 200})}.width('100%').height('100%')}}
5. [Java UI] The name of the app generated during real machine debugging is always entry_Mainability. How to customize the name?
Please modify the name and value in the resource→base→element→string.json file in the corresponding resource directory. Each language needs to be modified:
{"string": [{"name": "entry_MainAbility","value": "entry_MainAbility"}]}
For more technical articles, please visit: https://developer.huawei.com/consumer/cn/forum/topic/0203810194016170224?fid=0101587866109860105?ha_source=zzh |
边栏推荐
- WebSocket的实际应用
- 2022 the first of the new league henan (4) : zhengzhou university of light industry G - maze
- EssilorLuxottica借助Boomi的智能集成平台实现订单处理的现代化
- 工程制图-齿轮
- How many moments have you experienced the collapse of electronic engineers?
- 接口测试框架实战(二)| 接口请求断言
- 6.神经网络剖析
- 接口测试实战| GET/POST 请求区别详解
- 4.深度学习的几何解释与梯度的优化
- 数据库性能系列之索引(中)
猜你喜欢
Problems that need to be solved for interrupting the system
直播|StarRocks 技术内幕 :低基数全局字典优化
【Harmony OS】【ARK UI】轻量级数据存储
OSI的分层特点、传输过程与三次握手、四次挥手、tcp与udp包头的描述
普乐蛙VR台风体验馆厂家VR防震减灾模拟VR沉浸式体验设备
CobalStrike(CS)基础超级详细版
MCM箱模型建模方法及大气O3来源解析
【HMS core】【Ads Kit】华为广告——海外应用在国内测试正式广告无法展示
接口测试框架实战(四)| 搞定 Schema 断言
社交电商:链动2+1模式,为什么能在电商行业生存那么久?
随机推荐
【uni-APP搭建项目】
正则表达式绕过
常见荧光染料修饰多种基团及其激发和发射波长数据一览数据
Assembly answers
在线密码生成工具推荐
社交电商:链动2+1模式,为什么能在电商行业生存那么久?
直播|StarRocks 技术内幕 :低基数全局字典优化
接口测试框架实战(二)| 接口请求断言
t条件判断语句与if循环
I ported GuiLite to STM32F4 board
2022 the first of the new league henan (4) : zhengzhou university of light industry G - maze
DC-6靶场下载及渗透实战详细过程(DC靶场系列)
2.何为张量
leetcode刷题学习之路
如何利用 Flutter 实现炫酷的 3D 卡片和帅气的 360° 展示效果
MediaRecorder录制屏幕时在部分机型上报错prepare failed:-22
8.电影评论分类:二分类问题
【翻译】开发与生产中的Kubernetes修复成本对比
install ambari
2022河南萌新联赛第(四)场:郑州轻工业大学 G - 迷宫