当前位置:网站首页>【Harmony OS】【FAQ】鸿蒙问题合集1
【Harmony OS】【FAQ】鸿蒙问题合集1
2022-08-03 04:21:00 【华为开发者论坛】
1、【ArkUI】eTS方式显示Toast
import prompt from '@system.prompt'
@Entry
@Component
struct 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%')
}
}显示效果:

2、【DevEco Device Tool】无法找到工具对应下载链接
HarmonyOS官网无法找到DevEco Device Tool工具对应下载链接
1、当前工具临时下线优化中,预计12月30日(星期四)会上线3.0Beta2版本
2、可以通过账号登录此链接,DP平台-集成开发页签可以下载

3、【Java UI】如何调试鸿蒙应用运行至真机
真机运行调试应用需要先获取udid,然后在AGC控制台添加设备信息。
获取UDID命令行如下:
adb shell bm get -u可以参考官方网站应用调试指南:文档中心
编译生成hap包指南:文档中心
4、【ArkUI】ets开发时,如何设置组件的最小宽度或者最大宽度?
可以参考以下API方式可以设置最大和最小宽度:
/**
* 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;以下为ets代码:
@Entry
@Component
struct 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】真机调试时生成的app的名字一直都是entry_Mainability 如何自定义名字呢?
请在对应资源目录resource→base→element→string.json文件中的name和value,每个语言对应的都需要修改:
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
}
]
}| 欲了解更多更全技术文章,欢迎访问:https://developer.huawei.com/consumer/cn/forum/topic/0203810194016170224?fid=0101587866109860105?ha_source=zzh |
边栏推荐
- 数商云供应链集成系统开发方案:多行业集成平台管理自动化
- TCP相关面试常问
- 安装ambari
- MySQL 出现 The table is full 的解决方法
- 肖sir ——自动化讲解
- The flink sql task is changed, and after adding several fields to the sql, an error occurs when restoring from the previously saved savepoint.
- 阿里面试官:聊聊如何格式化Instant
- Redis-Redisson介绍和用途
- 链动2+1模式简单,奖励结构丰厚,自主裂变?
- Can Oracle EMCC be installed independently?Or does it have to be installed on the database server?
猜你喜欢

修饰生物素DIAZO-生物素-PEG3-DBCO|重氮-生物素-三聚乙二醇-二苯基环辛炔

数据库性能系列之索引(中)

社交电商:流量红利已尽,裂变营销是最低成本的获客之道

9.新闻分类:多分类问题

链动2+1模式简单,奖励结构丰厚,自主裂变?

关于#sql#的问题,如何解决?

Shenzhen Offline Registration|StarRocks on AWS: How to conduct rapid and unified analysis of real-time data warehouses

工程水文学试题库

移动流量的爆发式增长,社交电商如何选择商业模式

视频中场的概念(1080I和1080P)和BT601/656/709/1120/2020/2077
随机推荐
Live | StarRocks technology insider: low base dictionary global optimization
Redis缓存雪崩、缓存穿透、缓存击穿
OSI的分层特点、传输过程与三次握手、四次挥手、tcp与udp包头的描述
2022中国五金制品行业发展前景分析
链动2+1模式简单,奖励结构丰厚,自主裂变?
C# WPF设备监控软件(经典)-上篇
私域流量引流方法?分享购火爆的商业模式,你值得拥有
记录一些遇见的bug——mapstruct和lombok同时使用时,转换实体类时数据丢失问题
13.机器学习基础:数据预处理与特征工程
UV 裂解的生物素-PEG2-叠氮|CAS:1192802-98-4生物素接头
IO进程线程->线程->day5
SeleniumWebDriver扩展插件开发
Redis连接不上的报错解决方案汇总
中断系统需要解决的问题
DDL操作数据库、表、列
Smart fitness gesture recognition: PP - TinyPose build AI virtual trainer!
3.张量运算
Shell条件语句判断
汇编书摘抄
Oracle EMCC可以独立安装吗?还是必须安装到数据库服务器上?