背景前面已输出多个系列:《[十余种编程语言做个计算器](https:cxyxy.blog.csdn.netarticledetails128761660)》《[十余种编程语言写2048小游戏](https:cxyxy.blog.csdn.netarticledetails128696358)》《[17种编程语言+10种排序算法](https:cxyxy.blog.csdn.netarticledetails128760848)》《[十余种编程语言写博客系统](https:cxyxy.blog.csdn.netarticledetails128755326)》《[十余种编程语言写云笔记](https:cxyxy.blog.csdn.n...
2023-03-11 21:44:30 4676浏览 1点赞 0回复 0收藏
目标为编程初学者打造入门学习项目,使用各种主流编程语言来实现。让想学编程的,一个都不落下。上述基本涵盖了当前编程开发所有主流语言(我这里说的主流,直白点讲就是互联网公司都在用的)。左侧为前端版本:安卓、iOS、鸿蒙、Flutter、Vue、uniapp。右侧为服务器端版本:Java、Python、Go、Php、NodeJS鸿蒙版效果图工程截图开源地址[https:gitee.comlblbccloudblogs](https:gitee.comlblbccloudblogstreemasterblogclientbl...
2022-11-12 23:02:04 8057浏览 1点赞 0回复 0收藏
什么是HiLogHiLog是鸿蒙程序用来打印日志的工具,相比于默认的控制台(println)输出,Log支持分级别过滤日志,方便按照关键字进行过滤等.基础样例1.代码javafinalHiLogLabellabelnewHiLogLabel(HiLog.LOGAPP,0,"[花生皮编程]");HiLog.debug(label,"打印调试信息");HiLog.info(label,"打印一般信息");HiLog.warn(label,"打印警告信息");HiLog.error(label,"打印错误信息");HiLog.fatal(label,"打印致命错误信息");HiLog.debug,用于打...
2021-12-06 22:02:11 7596浏览 3点赞 0回复 0收藏
什么是ToastToast是用来短时显示提示信息并自动消失的UI控件.默认一般显示在屏幕的下方.基础样例1.显示默认toast效果图:代码:javanewToastDialog(getContext()).setText("花生皮编程,哈哈").show();2.在顶部显示toast效果图:代码:javaToastDialogdialognewToastDialog(getContext());dialog.setText("花生皮编程,哈哈");dialog.setAlignment(LayoutAlignment.TOP);dialog.show();3.居中显示toast效果图:代码:javaToastDialogd...
2021-12-05 22:23:37 7624浏览 0点赞 0回复 0收藏
什么是TableLayoutTableLayout又称表格布局,用于以表格形式展示内容.1.样例:22表格效果图代码xml2.样例:33表格效果图代码xml完整源代码https:gitee.comhspbcharmonyosdemostreemastertableLayoutDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos:height设置控件高度,可设置为:matchparent(和父控件一样),matchcontent(按照内容...
2021-12-02 21:33:22 6468浏览 1点赞 0回复 0收藏
什么是DependentLayoutDependentLayout又称依赖布局,是鸿蒙开发中几个常用的布局之一,使用频率最高.支持相对于父控件或同级兄弟控件进行定位.基础样例1.相对父控件定位效果图代码xml2.相对同级兄弟控件对齐设置本控件的一侧和目标控件(同级兄弟控件)的同侧对齐,如左侧对齐、右侧对齐.效果图代码xml完整源代码https:gitee.comhspbcharmonyosdemostreemasterdependentLayoutDemo常用属性说明属性名用途ohos:width设置控件宽度,可...
2021-12-02 21:29:39 6310浏览 2点赞 0回复 1收藏
什么是PositionLayoutPositionLayout又称准确位置布局,或绝对定位布局,子控件会指定精确的位置.这种布局方式一般很少使用,因为屏幕大小千奇百怪,一般都不能指定绝对的位置,否则会很难看。基础样例效果图代码xml完整源代码https:gitee.comhspbcharmonyosdemostreemasterpositionLayoutDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如20...
2021-11-29 22:42:52 6055浏览 0点赞 0回复 0收藏
什么是RoundProgressBarRoundProgressBar是用于展示进度的圆形UI控件.1.基本用法效果图代码xml2.设置进度条颜色和粗细效果图代码xml3.设置中间显示文字效果图代码xml4.设置弧形显示效果图代码xml基础样例完整源代码https:gitee.comhspbcharmonyosdemostreemasterroundProgressBarDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos...
2021-11-29 22:42:20 7167浏览 1点赞 0回复 0收藏
什么是StackLayoutStackLayout又称层叠布局,其定位方式非常简单,所有控件都默认定位左上角.也支持将子控件显示在父控件的上下左右及正中间.基础样例1.默认定位样例效果图代码xml2.相对父控件定位效果图代码xml完整源代码https:gitee.comhspbcharmonyosdemostreemasterstackLayoutDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos...
2021-11-29 22:41:44 7142浏览 0点赞 0回复 0收藏
什么是DirectionalLayoutDirectionalLayout又称方向布局,是鸿蒙开发中几个常用的布局之一,使用频率较高,而且非常简单.布局内的控件依次排列,支持横向或纵向排列.基础样例1.纵向排列效果图代码xml代码说明:1.设置ohos:orientation为vertical,展示方向变成纵向2.DirectionalLayout里面包括了三个显示文本的Text.2.横向排列效果图代码xml代码说明:1.设置ohos:orientation为horizontal,展示方向变成横向.3.调整子控件摆放位置(gravi...
2021-11-26 22:16:08 6532浏览 2点赞 0回复 0收藏
什么是PageFlipperPageFlipper是用于实现整页自动切换,类似PPT幻灯片自动播放.效果图:基础用法1.在主布局文件"abilitymain.xml"中增加PageFlipperxml2.在Slice中实例化PageSlider,设置数据javapublicclassMainAbilitySliceextendsAbilitySlice{OverridepublicvoidonStart(Intentintent){super.onStart(intent);super.setUIContent(ResourceTable.Layoutabilitymain);PageFlipperpageSlider(PageFlipper)findComponentById(ResourceTable.Idpageflipper);for(inti1;i
2021-11-26 22:15:11 7633浏览 2点赞 0回复 2收藏
什么是PageSlider、PageSliderIndicatorPageSlider是用于实现整页切换.PageSliderIndicator用于辅助显示当前所处页面。效果图:基础用法1.在主布局文件"abilitymain.xml"中增加PageSlider和PageSliderIndicatorxml2.在Slice中实例化PageSlider,设置数据javapublicclassMainAbilitySliceextendsAbilitySlice{OverridepublicvoidonStart(Intentintent){super.onStart(intent);super.setUIContent(ResourceTable.Layoutabilitymain...
2021-11-26 22:14:09 6386浏览 1点赞 0回复 0收藏
什么是PageSliderPageSlider是用于实现整页切换.效果图:基础用法1.在主布局文件"abilitymain.xml"中增加PageSliderxml2.在Slice中实例化PageSlider,设置数据javapublicclassMainAbilitySliceextendsAbilitySlice{OverridepublicvoidonStart(Intentintent){super.onStart(intent);super.setUIContent(ResourceTable.Layoutabilitymain);PageSliderpageSlider(PageSlider)findComponentById(ResourceTable.Idpagerslider);Layout...
2021-11-26 22:13:23 7165浏览 1点赞 0回复 0收藏
什么是ListContainerListContainer是用于显示列表的UI控件.效果图:基础用法1.在主布局文件"abilitymain.xml"中增加ListContainerxml2.新增一个Provider用于展示列表中每一行内容布局文件:listcontaineritem.xmljava代码:MyProvider.javaimportohos.agp.components.;importjava.util.List;publicclassMyProviderextendsBaseItemProvider{privatefinalListdataList;publicMyProvider(ListdataList){this.dataListdataList;}Ove...
2021-11-22 22:16:20 9619浏览 3点赞 0回复 0收藏
什么是SliderSlider是让用户调节进度的UI控件.常见效果如下:1.基本用法效果图代码xml2.设置进度条颜色效果图代码xml3.设置进度条上文字效果图代码xml4.设置进度条文字位置效果图代码xml基础样例完整源代码https:gitee.comhspbcharmonyosdemostreemastersliderDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos:height设置控件高...
2021-11-22 22:15:36 7744浏览 1点赞 0回复 0收藏
什么是TabListTabList一般用来实现标签栏.常见效果如下:基本用法1)布局文件代码:xml2)java代码:javapublicclassMainAbilitySliceextendsAbilitySlice{OverridepublicvoidonStart(Intentintent){super.onStart(intent);super.setUIContent(ResourceTable.Layoutabilitymain);Texttext(Text)findComponentById(ResourceTable.Idtexttitle);TabListtabList(TabList)findComponentById(ResourceTable.Idtablist);TabList.Tabta...
2021-11-22 22:14:53 7823浏览 1点赞 0回复 0收藏
什么是DatePickerDatePicker是一种日期滚轮式选择器.常见效果如下:1.基本用法效果图代码xml2.设置背景效果图代码xml3.设置文字字体大小和颜色效果图代码xml4.设置分割条颜色效果图代码xml基础样例完整源代码https:gitee.comhspbcharmonyosdemostreemasterdatePickerDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos:height设置...
2021-11-13 20:41:49 8195浏览 1点赞 0回复 0收藏
什么是TimePickerTimePicker是一种时间滚轮式选择器.常见效果如下:1.基本用法效果图代码xml2.设置背景效果图代码xml3.设置文字字体大小和颜色效果图代码xml4.设置分割条颜色效果图代码xml基础样例完整源代码https:gitee.comhspbcharmonyosdemostreemastertimePickerDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos:height设置...
2021-11-13 20:41:03 7521浏览 1点赞 0回复 0收藏
什么是PickerPicker是一种滚轮式选择器.常见效果如下:1.基本用法效果图代码xml2.设置背景效果图代码xml3.设置文字字体大小和颜色效果图代码xml4.设置分割条颜色效果图代码xml基础样例完整源代码https:gitee.comhspbcharmonyosdemostreemasterpickerDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos:height设置控件高度,可设置为...
2021-11-13 20:39:55 8585浏览 1点赞 0回复 0收藏
什么是RoundProgressBarRoundProgressBar是用于展示进度的圆形UI控件.1.基本用法效果图代码xml2.设置进度条颜色和粗细效果图代码xml3.设置中间显示文字效果图代码xml4.设置弧形显示效果图代码xml基础样例完整源代码https:gitee.comhspbcharmonyosdemostreemasterroundProgressBarDemo常用属性说明属性名用途ohos:width设置控件宽度,可设置为:matchparent(和父控件一样),matchcontent(按照内容自动伸缩),设置固定值(如200vp)ohos...
2021-11-13 20:12:44 7856浏览 1点赞 0回复 0收藏