当前位置:网站首页>【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 |
边栏推荐
猜你喜欢

UV 裂解的生物素-PEG2-叠氮|CAS:1192802-98-4生物素接头

正则表达式绕过

【Harmony OS】【ARK UI】ETS 上下文基本操作

【Harmony OS】【ARK UI】ets使用startAbility或startAbilityForResult方式调起Ability

Test drive: project management module - curd development project

在线密码生成工具推荐

DFS对剪枝的补充

在竞争白热化的电商行业,链动2+1为什么还有企业在用

SM30 表维护视图数据保存前 数据校验事件

Record some bugs encountered - when mapstruct and lombok are used at the same time, the problem of data loss when converting entity classes
随机推荐
redis键值出现 xacxedx00x05tx00&的解决方法
索引创建、删除与使用
接口测试实战| GET/POST 请求区别详解
【翻译】开发与生产中的Kubernetes修复成本对比
肖sir___面试就业课程____性能测试
2022河南萌新联赛第(四)场:郑州轻工业大学 E - 睡大觉
1.一个神经网络示例
Shenzhen Offline Registration|StarRocks on AWS: How to conduct rapid and unified analysis of real-time data warehouses
种草一个让程序员男友编程时,记住一辈子的 IDEA 神仙插件!
计组错题集
接口和协议
肖sir__自动化面试题
浏览器监听标签页关闭
MySQL 出现 The table is full 的解决方法
寄存器(内存访问)
肖sir___面试就业课程____app
7.Keras开发简介
【Harmony OS】【ARK UI】轻量级数据存储
Can Oracle EMCC be installed independently?Or does it have to be installed on the database server?
js中的闭包