当前位置:网站首页>【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 -uYou 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 |
边栏推荐
猜你喜欢
随机推荐
Redis缓存雪崩、缓存穿透、缓存击穿
2.何为张量
ScanNet数据集讲解与点云数据下载
OpenFOAM extracts equivalency and calculates area
"Obs" start pushing flow failure: the Output. The StartStreamFailed call process
unity2D横板游戏教程6-敌人AI以及受击动画
MySQL 入门:Case 语句很好用
关于#sql#的问题,如何解决?
MCM箱模型建模方法及大气O3来源解析
3.张量运算
Dialog manager in the fourth chapter: the dialog message loop
WebSocket的实际应用
2022/08/02 学习笔记 (day22) 多线程
SkiaSharp 之 WPF 自绘 五环弹动球(案例版)
索引创建、删除与使用
那些让电子工程师崩溃瞬间,你经历了几个呢?
安装ambari
MySQL 出现 The table is full 的解决方法
CobalStrike(CS)基础超级详细版
4.深度学习的几何解释与梯度的优化









