学堂
精培
企业培训
CTO训练营
鸿蒙社区
收藏本站
公众号矩阵
移动端
私信
主帖 5
回帖 1
视频
提问 3
回答 2
资源
专栏
一:效果图二:调用demoprivatevoidshow(Stringmessage){MyToastDialogtoastDialog(MyToastDialog)newMyToastDialog(getContext())setDuration(500)setAlignment(LayoutAlignmentBOTTOM)setOffset(0,100);toastDialogsetText(message);toastDialogshow();}三:代码importohosagpcomponentsAttrHelper;importohosagpcomponentsComponentContainer;importohosagpcomponentsDirectionalLayout;importohosagpcomponentsText;importo...
2021-05-13 15:43:54 2716浏览 3点赞 2回复 1收藏
方便需要用到时,直接拷贝1,绘制横线linePaintnewPaint();linePaintsetColor(ColorBLACK);linePaintsetAntiAlias(true);linePaintsetStrokeWidth(1f);linePaintsetStyle(PaintStyleFILLSTYLE);canvasdrawLine(0,200,width,200,linePaint);canvasdrawLine(0,100,width,100,linePaint);canvasdrawLine(0,300,width,300,linePaint);2,绘制圆circlePaintnewPaint();circlePaintsetColor(ColorBLUE);circlePaintsetAntiAlias(true)...
2021-04-30 11:33:39 2949浏览 3点赞 0回复 2收藏
官方指导地址:https:developerharmonyoscomcndocsdocumentationdocguidesmediavideoplayer0000000000044178关键步骤1player初始化playernewPlayer(getContext());2,设置Source;视频播放的源(可以是本地,也可以是网络)目前只研究到放文件在工程里privateStringurl"entryresourcesbasemediagubeishuizhenmp4";RawFileDescriptorfdnull;try{fdgetContext()getResourceManager()getRawFileEntry(url)openRawFileDescriptor();...
2021-04-26 20:36:52 3639浏览 5点赞 3回复 1收藏
官方链接:https:developerharmonyoscomcndocsdocumentationdocguidesabilitypageswitching0000000000037999一:同一Page内导航present(newTargetSlice(),newIntent());希望能够获得其返回结果ASlice跳转BSlicepresentForResult(newTargetSlice(),newIntent(),111);BSlice返回带结果代码findComponentById(ResourceTableIdbackresultbtn)setClickedListener(component>{IntentresultIntentnewIntent();resultIntentsetParam("re...
2021-04-23 11:30:15 1380浏览 3点赞 0回复 0收藏
码生成能够根据开发者给定的字符串信息和二维码图片尺寸,返回相应的二维码图片字节流。调用方可以通过二维码字节流生成二维码图片官网文档地址:https:developerharmonyoscomcndocsdocumentationdocguidesaicodegenrationguidelines0000001050822133目前已知问题:中文弄得二维码扫码出来是乱码!如何解决谁知道?附代码:https:developerharmonyoscomcndocsdocumentationdocguidesaicodegenrationguidelines0000001050822133<...
2021-04-22 11:11:18 3267浏览 0点赞 0回复 0收藏