当前位置:网站首页>【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 |
边栏推荐
- Browser listens for tab closing
- OpenFOAM extracts equivalency and calculates area
- DDL操作数据库、表、列
- 接口测试框架实战(一) | Requests 与接口请求构造
- MediaRecorder录制屏幕时在部分机型上报错prepare failed:-22
- BIOTIN ALKYNE CAS:773888-45-2价格,供应商
- 【开发者必看】【push kit】推送服务服务典型问题合集2
- 深圳线下报名|StarRocks on AWS:如何对实时数仓进行极速统一分析
- OSI的分层特点、传输过程与三次握手、四次挥手、tcp与udp包头的描述
- 直播|StarRocks 技术内幕 :低基数全局字典优化
猜你喜欢
随机推荐
t条件判断语句与if循环
【开发者必看】【push kit】推送服务服务典型问题合集2
Redis缓存雪崩、缓存穿透、缓存击穿
普乐蛙VR台风体验馆厂家VR防震减灾模拟VR沉浸式体验设备
Shell条件语句判断
1.一个神经网络示例
UV 裂解的生物素-PEG2-叠氮|CAS:1192802-98-4生物素接头
移动流量的爆发式增长,社交电商如何选择商业模式
安装ambari
TCP 和UDP 的详细介绍
DC-6靶场下载及渗透实战详细过程(DC靶场系列)
【翻译】开发与生产中的Kubernetes修复成本对比
CobalStrike(CS)基础超级详细版
Mysql如何建立索引实现语句优化
【软件工程之美 - 专栏笔记】35 | 版本发布:软件上线只是新的开始
t conditional judgment statement and if loop
StarRocks 7 月社区动态
Windows 安装PostgreSQL
表的创建、修改与删除
mysql 创建索引的三种方式