HarmonyOS 引入har编译失败
可使用集成态hsp,当前hsp目录结构有问题,建议新建一个hsp,导出native方法时需要间接导出。https:developer.huawei.comconsumercndocharmonyosguidesV5inapphspV5
HarmonyOS 应用安装失败9568347
该报错解决方案请参考:https:developer.huawei.comconsumercndocharmonyosguidesV5bmtoolV5section9568347解析本地so文件失败
HarmonyOS 元服务中获取时间
demo参考:import{authentication}from'kit.AccountKit';import{BusinessError}from'kit.BasicServicesKit';import{hilog}from'kit.PerformanceAnalysisKit';EntryComponentstructIndex{Statemessage:string'HelloWorld';build(){Column(){Button('test').onClick(()>{lettimestamp1this.getDateStringWithTimeStamp(1719283655000)lettimestamp2this.getDateStringWithTimeStamp(1719995386863)console.info('timestamp1',time...
HarmonyOS Flutter textfield输入框长按不显示复制粘贴menu
1、更新flutter.har:https:gitee.comopenharmonysigflutterflutterpulls2762、权限变更,应用需要在module.json5配置文件的requestPermissions标签中声明剪贴板权限,ohos.permission.READPASTEBOARD。3、请配置该权限后,重新签名再验证该问题。4、参考连接:https:gitee.comopenharmonysigflutterengineissuesIA4GOG
HarmonyOS RN跨页面通讯通讯除了通知,是否还有其他方式?
1、RN与RN页面之间通信除了通知,还可以通过Navigation、Redux或MobX等方式进行,具体可以自行学习RN相关知识。2、RN与HarmonyOS之间的通讯请参考指导文档https:gitee.comopenharmonysigohosreactnativeblob0.72.5ohos5.0releasedocszhcn%E4%B8%A4%E7%AB%AF%E9%80%9A%E8%AE%AF.md中“两端通讯.pdf”。
HarmonyOS @react-native-camera-roll/camera-roll使用报错
使用方式有误,传入的path不符合应用沙箱path规定file:media是媒体库沙箱的uri,不支持从媒体库创建到媒体库,需要使用file:com.rnoh.testerdatastorageel2basehapsentryfiles2.jpg,这种写法参考一下链接:https:developer.huawei.comconsumercndocharmonyosguidesV5appsandboxdirectoryV5
HarmonyOS app_icon只能41x41吗
关于应用图标需为正方形。尺寸:216216px;格式:PNG(500KB以内)、WEBP(100KB以内)。参考链接1:https:developer.huawei.comconsumercndocappagchelpappmaterialrequirement0000001146534651参考链接2:https:developer.huawei.comconsumercndocdesignguidesV1appicon0000001188065088V1生成应用图标:https:developer.huawei.comconsumercndocharmonyosguidesV5ideapplygeneratedicon0000001726018714V5
HarmonyOS 使用RN开发的时候,Flatlist实现下拉刷新可以使用refreshControl,但是系统的RefreshControl在使用的时候体验不佳,往上滑的时候也会触发,还会出现页面白屏等现象,有什么好的解决办法吗?
可以参考下以下的demo:importReact,{useState,useEffect}from'react';import{FlatList,View,Text,ActivityIndicator,StyleSheet}from'reactnative';constMyComponent()>{const[data,setData]useState([]);const[loading,setLoading]useState(false);const[page,setPage]useState(1);constfetchData()>{setLoading(true);模拟从API获取数据setTimeout(()>{constnewDataArray.from({length:10},(,index)>({id:index+1,text:Item$...
HarmonyOS QDesktopServices::openUrl打开文件夹时提示暂无支持此类文件的应用
通过startAbility()方式代替打开文管。并设置bundleName"com.huawei.hmos.filemanager"、abilityName"MainAbility"参考下方文档链接设置uri和type,通过隐式方式匹配应用。https:developer.huawei.comconsumercndocharmonyosguidesV5explicitimplicitwantmappingsV5want%E5%8F%82%E6%95%B0%E7%9A%84uri%E5%92%8Ctype%E5%8C%B9%E9%85%8D%E8%A7%84%E5%88%99拉起文管的want格式如下:bundleName:"com.huawei.hmos.filemanager",abilityName:"MainAbility",parameters:{要查看的文件(夹)Uri'fileUri':类型:string}
HarmonyOS 连接蓝牙一直报错:BussinessError 2900099: Operation failed
HarmonyOS使用的mac地址不是真实的mac地址,而是扫描方法回调的mac,设备未配对时,每次扫描的mac都会变化,所以所有蓝牙流程都要基于前置扫描方案实现ble使用gatt通信可参考样例中设置:https:gitee.comopenharmonyapplicationsappsamplesblobmastercodeBasicFeatureConnectivityBluetoothentrysrcmainetsviewmodelBluetoothViewModel.ets
HarmonyOS 关于lottie加载问题
问题一:加载本地动画,將动画需要的json文件放到pages同级别目录下,然后引用。path参数:只支持加载entrysrcmainets文件夹下的相对路径,不支持跨包查找文件。注意:json文件路径不能使用.或者…等相对路径,相对路径获取不到动画源数据,会导致动画加载不出来,传递给loadAnimation方法的路径是相对于pages父文件夹为基准的,而index页面内引入的相对路径的动画是以index.ets文件为基准的,两者基准不一致。问题2:删除多余的...