当前位置:网站首页>第四次培训
第四次培训
2022-08-03 05:10:00 【曲水流觞683】
本次开发主要讲述的是拍照功能的实现
主要利用了:
camera组件
以下为相关示例:
<!-- xxx.hml-->
<div class="container">
<camera flash="on" deviceposition="back" @error="cameraError">
</camera>
</div>
/* xxx.css */
.container {
display: flex;
justify-content: center;
align-items: center;
}
camera{
width: 300px;
height: 300px;
}
//xxx.js
import prompt from '@system.prompt';
export default {
data: {
title: 'World'
},
cameraError(){
prompt.showToast({
message: "授权失败!"
});
}
}
web组件
首先要添加权限列表:ohos.permission.INTERNET
一个页面只支持一个web组件,会全屏显示,若页面中还有其他组件,会被web组件覆盖,web组件不跟随转场动画


边栏推荐
猜你喜欢

【Harmony OS】【FAQ】Hongmeng Questions Collection 1

typescript45-接口之间的兼容性

typescript44-对象之间的类兼容器

1. 两数之和

UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors

2. 两数相加

PotPlayer实现上班摸鱼电视自由

BIOTIN ALKYNE CAS: 773888-45-2 Price, Supplier

力扣561. 数组拆分

Peptides mediated PEG DSPE of phospholipids, targeted functional materials - PEG - RGD/TAT/NGR/APRPG
随机推荐
Alienware上线首个数字时装AR试穿体验
2017-06-11 Padavan 完美适配newifi mini【adbyby+SS+KP ...】youku L1 /小米mini
2022暑假牛客多校联赛第一场
如何不耍流氓的做运维之-SHELL脚本
Install IIS services (Internet Information Services (Internet Information Services, abbreviated IIS, Internet Information Services)
tag单调栈-单调栈预备知识-lt.739. 每日温度
Unity2D horizontal board game tutorial 6 - enemy AI and attack animation
Business table analysis - balance system
shell脚本循环语句
设计模式——组合模式、享元模式(Integer缓存)(结构型模式)
odps的临时查询能在写sql的时候就给结果一个命名不?
2022/08/02 学习笔记 (day22) 多线程
1095 解码PAT准考证 (25 分)(C语言)
【Biotin Azide|cas:908007-17-0】Price_Manufacturer
Practical application of WebSocket
【 Harmony OS 】 【 ano UI 】 lightweight data storage
接口测试框架实战(二)| 接口请求断言
BIOTIN ALKYNE CAS: 773888-45-2 Price, Supplier
Ali cloud object storage oss private barrels to generate links
idea uses @Autowired annotation to explain the reasons and solutions