什么是AbilityAbility是鸿蒙应用提供能力的一种抽象。Ability又分为:FA(Feature Ability)和PA(Particle Ability)两种。Feature Ability支持Page Ability,那什么是Page Ability呢? 其实就是你所看到的各个界面,每个界面都是一个Page Ability.如果把整个app比作一个商场,那Page Ability就
什么是TableLayout TableLayout又称表格布局,用于以表格形式展示内容. 1. 样例:2*2表格 效果图 代码 <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:ohos="http://schemas.huawei.com/
什么是ToastToast是用来短时显示提示信息并自动消失的UI控件. 默认一般显示在屏幕的下方. 基础样例显示默认toast 效果图:代码: new ToastDialog(getContext()).setText("花生皮编程,哈哈").show(); 在顶部显示toast 效果图:代码: ToastDialog dialog = new Toas
什么是HiLogHiLog是鸿蒙程序用来打印日志的工具,相比于默认的
个人介绍厦门大学计算机专业|华为八年高级工程师 进行中《零基础学Flutter编程》 《零基础学微信小程序编程》 《零基础学抖音小程序编程》 《零基础学前端编程》 《零基础学Python编程》 《零基础学C#编程》 《零基础学C++编程》 《零基础学C语言编程》 开源项目 基础框架安卓App开发MVVM框架 实例学习用十种编程语言开发计算器应用安卓A
背景不少浏览器在显示push消息时,采用半屏显示,顶部会露出一截,同时页面支持上下滑动,下滑还可以关闭页面。下面是UC浏览器的效果:!UC浏览器效果(https://s4.51cto.com/images/blog/202111/06141902_61861e5670c2e96120.gif?xossprocess=image/watermark,size_14,text_QDUxQ1RP5Y2a
什么是PageSliderPageSlider是用于实现整页切换.效果图:基础用法在主布局文件"ability_main.xml"中增加PageSlider <PageSlider ohos:id="$+id:pager_slider" ohos:height="match_parent" ohos:width="match_parent"/>2. 在Slice中实例化PageSlider,设置数据public class
什么是RoundProgressBarRoundProgressBar是用于展示进度的圆形UI控件.1.基本用法效果图代码 <RoundProgressBar ohos:height="100vp" ohos:width="100vp" ohos:progress="20"/>2.设置进度条颜色和粗细效果图代码 <RoundProgressBar ohos:height="100vp"
什么是SliderSlider是让用户调节进度的UI控件.常见效果如下:1.基本用法效果图代码<Slider ohos:id="$+id:slider" ohos:height="match_content" ohos:width="match_parent" ohos:max="100" ohos:min="0" ohos:orientation="horizontal" o
什么是ListContainerListContainer是用于显示列表的UI控件.效果图:基础样例用法介绍在主布局文件"ability_main.xml"中增加ListContainer <ListContainer ohos:id="$+id:list_container" ohos:height="match_content" ohos:width="match_parent" ohos:layout_alignme
什么是PageFlipperPageFlipper是用于实现整页自动切换,类似PPT幻灯片自动播放.效果图:基础用法在主布局文件"ability_main.xml"中增加PageFlipper <PageFlipper ohos:id="$+id:page_flipper" ohos:height="match_parent" ohos:width="match_parent"/>在Slice中实例化PageSlider,
什么是DirectionalLayoutDirectionalLayout又称方向布局,是鸿蒙开发中几个常用的布局之一,使用频率较高,而且非常简单.布局内的控件依次排列,支持横向或纵向排列.基础样例1. 纵向排列效果图代码<?xml version="1.0" encoding="utf-8"?><DirectionalLayout xmlns:ohos="http://schemas.huawei.com/res/ohos" ohos:height="ma
什么是PageSlider、PageSliderIndicatorPageSlider是用于实现整页切换.PageSliderIndicator用于辅助显示当前所处页面。效果图:基础用法在主布局文件"ability_main.xml"中增加PageSlider和PageSliderIndicator<StackLayout xmlns:ohos="http://schemas.huawei.com/res/ohos" ohos:height="match_parent
目标启用DevEco Studio中本地模拟器,提升开发效率。# DevEco Studio版本需要3.0Beta1及以上版本# 操作步骤1.打开DevEco Studio设置界面,勾选“Enable Local Emulator”2. 点击“No Devices”,选择“Device Manager”3. 点击“New Emulator”4. 点击“下一步”5. 点击下载按钮6. 点击“下一步”7. 点击“完成”8. 点击绿色箭头按钮启动模拟器7. 运行鸿蒙工程到模拟器上效果图:...
什么是PositionLayoutPositionLayout又称准确位置布局,或绝对定位布局,子控件会指定精确的位置.这种布局方式一般很少使用,因为屏幕大小千奇百怪,一般都不能指定绝对的位置,否则会很难看。基础样例效果图代码<?xml version="1.0" encoding="utf-8"?><PositionLayout xmlns:ohos="http://schemas.huawei.com/res/ohos" ohos:height="mat
什么是DependentLayoutDependentLayout又称依赖布局,是鸿蒙开发中几个常用的布局之一,使用频率最高.支持相对于父控件或同级兄弟控件进行定位.基础样例1. 相对父控件定位效果图代码<?xml version="1.0" encoding="utf-8"?><DependentLayout xmlns:ohos="http://schemas.huawei.com/res/ohos" ohos:height="match_parent"
什么是StackLayoutStackLayout又称层叠布局,其定位方式非常简单,所有控件都默认定位左上角.也支持将子控件显示在父控件的上下左右及正中间.基础样例1. 默认定位样例效果图代码<?xml version="1.0" encoding="utf-8"?><StackLayout xmlns:ohos="http://schemas.huawei.com/res/ohos" ohos:height="match_parent" ohos:
个人介绍厦门大学计算机专业华为八年高级工程师已完成《零基础学安卓编程》(https://cxyxy.blog.csdn.net/category_11409895.html)《零基础学Java编程》(https://cxyxy.blog.csdn.net/category_11331310.html)《零基础学鸿蒙编程》(https://cxyxy.blog.csdn.net/category_1
Copyright © 2005-2023 51CTO.COM 版权所有 京ICP证060544号