当前位置: 首页 > news >正文

15.鸿蒙HarmonyOS App(JAVA)进度条与圆形进度条

15.鸿蒙HarmonyOS App(JAVA)进度条与圆形进度条

progressBar2.setIndeterminate(true);//设置无限模式,运行查看动态效果
//创建并设置无限模式元素
ShapeElement element = new ShapeElement();
element.setBounds(0,0,50,50);
element.setRgbColor(new RgbColor(255,0,0));
progressBar2.setInfiniteModeElement(element);

<?xml version="1.0" encoding="utf-8"?>
<DirectionalLayoutxmlns:ohos="http://schemas.huawei.com/res/ohos"ohos:height="match_parent"ohos:width="match_parent"ohos:alignment="center"ohos:orientation="vertical"><Textohos:id="$+id:text_helloworld"ohos:height="match_content"ohos:width="match_parent"ohos:background_element="$graphic:background_ability_main"ohos:layout_alignment="horizontal_center"ohos:text="$string:mainability_HelloWorld"ohos:text_size="40vp"/><ProgressBarohos:id="$+id:progressbar1"ohos:height="match_content"ohos:width="match_parent"ohos:max="100"ohos:min="0"ohos:step="1"ohos:progress="30"/><ProgressBarohos:id="$+id:progressbar2"ohos:height="match_content"ohos:width="match_parent"ohos:max="100"ohos:min="0"ohos:step="1"ohos:progress="30"ohos:progress_hint_text="提示信息"ohos:progress_hint_text_color="blue"/><ProgressBarohos:id="$+id:progressbar3"ohos:height="match_content"ohos:width="match_parent"ohos:max="100"ohos:min="0"ohos:step="1"ohos:progress="30"ohos:progress_width="10vp"ohos:progress_color="red"ohos:background_instruct_element="green"/><ProgressBarohos:id="$+id:progressbar4"ohos:height="match_content"ohos:width="match_parent"ohos:max="100"ohos:min="0"ohos:step="1"ohos:progress="30"ohos:progress_width="10vp"ohos:progress_color="red"ohos:vice_progress_element="yellow"ohos:background_instruct_element="green"/><ProgressBarohos:id="$+id:progressbar5"ohos:height="match_content"ohos:width="match_parent"ohos:max="100"ohos:min="0"ohos:step="1"ohos:progress="30"ohos:progress_width="10vp"ohos:progress_color="red"ohos:divider_lines_enabled="true"ohos:divider_lines_number="20"ohos:background_instruct_element="green"/><ProgressBarohos:id="$+id:progressbar6"ohos:height="match_content"ohos:width="match_parent"ohos:max="100"ohos:min="0"ohos:step="1"ohos:progress="88"ohos:progress_width="10vp"ohos:progress_color="#FF90F575"ohos:divider_lines_enabled="true"ohos:divider_lines_number="60"ohos:background_instruct_element="green"ohos:layout_alignment="horizontal_center"ohos:progress_hint_text="提示内容"/><RoundProgressBarohos:id="$+id:roundprogressbar7"ohos:height="100vp"ohos:width="100vp"ohos:max="100"ohos:min="0"ohos:step="1"ohos:progress="88"ohos:progress_width="10vp"ohos:progress_color="#FF90F575"ohos:layout_alignment="horizontal_center"ohos:progress_hint_text="圆形进度条"ohos:progress_hint_text_color="blue"/></DirectionalLayout>

MainAbilitySlice.java

package com.example.myapplication.slice;import com.example.myapplication.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.colors.RgbColor;
import ohos.agp.components.ProgressBar;
import ohos.agp.components.RoundProgressBar;
import ohos.agp.components.element.ShapeElement;
import ohos.agp.utils.Color;public class MainAbilitySlice extends AbilitySlice {@Overridepublic void onStart(Intent intent) {super.onStart(intent);super.setUIContent(ResourceTable.Layout_ability_main);ProgressBar progressBar = (ProgressBar) findComponentById(ResourceTable.Id_progressbar1);progressBar.setDividerLineColor(Color.BLUE); //设置分割线颜色progressBar.setDividerLineThickness(30); //设置分割线宽度ProgressBar progressBar2 =(ProgressBar) findComponentById(ResourceTable.Id_progressbar2);progressBar2.setIndeterminate(true);//设置无限模式,运行查看动态效果RoundProgressBar roundProgressBar2 = (RoundProgressBar) findComponentById(ResourceTable.Id_roundprogressbar7);roundProgressBar2.setIndeterminate(true);//运行查看动态效果//创建并设置无限模式元素ShapeElement element = new ShapeElement();element.setBounds(0,0,50,50);element.setRgbColor(new RgbColor(255,0,0));progressBar2.setInfiniteModeElement(element);}@Overridepublic void onActive() {super.onActive();}@Overridepublic void onForeground(Intent intent) {super.onForeground(intent);}
}

相关文章:

15.鸿蒙HarmonyOS App(JAVA)进度条与圆形进度条

15.鸿蒙HarmonyOS App(JAVA)进度条与圆形进度条 progressBar2.setIndeterminate(true);//设置无限模式,运行查看动态效果 //创建并设置无限模式元素 ShapeElement element new ShapeElement(); element.setBounds(0,0,50,50); element.setRgbColor(new RgbColor(255,0,0)); …...

【FastAPI】路径参数

路径参数 from fastapi import FastAPIapp FastAPI()app.get("/items/{item_id}") async def read_item(item_id):return {"item_id": item_id}其中{item_id}就为路径参数 运行以上程序当访问 &#xff1a;http://127.0.0.1:8000/items/fastapi时候 将会…...

【docker笔记】DockerFile

DockerFile Docker镜像结构的分层 镜像不是一个单一的文件&#xff0c;而是有多层构成。 容器其实是在镜像的最上面加了一层读写层&#xff0c;在运行容器里做的任何文件改动&#xff0c;都会写到这个读写层。 如果删除了容器&#xff0c;也就是删除了其最上面的读写层&…...

React项目搭建流程

第一步 利用脚手架创建ts类型的react项目&#xff1a; 执行如下的命令&#xff1a;create-react-app myDemo --template typescript &#xff1b; 第二步 清理项目目录结构&#xff1a; src/ index.tsx, app.txs, react-app-env.d.ts public/index.ht…...

QT DAY1作业

1.QQ登录界面 头文件代码 #ifndef MYWIDGET_H #define MYWIDGET_H#include <QWidget> #include <QIcon> #include <QLabel> #include <QPushButton> #include <QMovie> #include <QLineEdit>class MyWidget : public QWidget {Q_OBJECTpu…...

Java后端开发——Mybatis实验

文章目录 Java后端开发——Mybatis实验一、MyBatis入门程序1.创建工程2.引入相关依赖3.数据库准备4.编写数据库连接信息配置文件5.创建POJO实体6.编写核心配置文件和映射文件 二、MyBatis案例&#xff1a;员工管理系统1.在mybatis数据库中创建employee表2.创建持久化类Employee…...

【UE Niagara 网格体粒子系列】02-自定义网格

目录 步骤 一、创建自定义网格体 二、创建Niagara系统 步骤 一、创建自定义网格体 1. 打开Blender&#xff0c;按下ShiftA来创建一个平面 将该平面旋转90 导出为fbx 设置导出选定的物体&#xff0c;这里命名为“SM_PlaneFaceCamera.fbx” 按H隐藏刚才创建的平面&#x…...

k8s 检测node节点内存使用率平衡调度脚本 —— 筑梦之路

直接上脚本&#xff1a; #! /bin/bash#对实际使用内存大于85%的机器停止调度&#xff0c;对实际使用内存小于70%的 关闭调度# 获取实际内存小于或等于70%的机器 memory_lt_70kubectl top nodes |awk NR>1{if($50<70) print $1} # 获取实际内存大于或等于85%的机器 memor…...

React Native集成到现有原生应用

本篇文章以MacOS环境开发iOS平台为例&#xff0c;记录一下在原生APP基础上集成React Native React Native中文网 详细介绍了搭建环境和集成RN的步骤。 环境搭建 必须安装的依赖有&#xff1a;Node、Watchman、Xcode 和 CocoaPods。 安装Homebrew Homebrew是一款Mac OS平台下…...

完全卸载grafana

先停掉grafana sudo systemctl stop grafana-server 查看要卸载的包的名字 yum list installed yum remove grafana-enterprise.x86_64 成功 删除grafana的数据目录 sudo rm -rf /etc/grafana/sudo rm -rf /usr/share/grafana/sudo rm -rf /var/lib/grafana/...

Vue2.组件通信

样式冲突 写在组件中的样式默认会全局生效。容易造成多个组件之间的样式冲突问题。 可以给组件加上scoped属性&#xff0c;让样式只作用于当前组件。 原理&#xff1a; 给当前组件模板的所有元素&#xff0c;加上一个自定义属性data-v-hash值&#xff0c;用以区分不同的组件。…...

CAS的超~详细介绍

什么是CAS CAS全称Compare and swap,是一种比较特殊的CPU指令. 字面意思:"比较并交换", 一个CAS涉及到以下操作: 我们假设内存中的原数据为V,旧的预期值A,需要修改的新值B. 1.比较A和V是否相等(比较) 2.如果相等,将B写入V.(交换) 3.返回操作是否成功. 伪代码 下面…...

Scott用户数据表的分析

Oracle从入门到总裁:https://blog.csdn.net/weixin_67859959/article/details/135209645 如果想要知道某个用户所有的数据表: select * from tab; 此时结果中一共返回了四张数据表&#xff0c;分别为部门表&#xff08;dept&#xff09; &#xff0c;员工表&#xff08;emp&a…...

网络基础学习(3):交换机

1.交换机结构 &#xff08;1&#xff09;网线接口和后面的电路部分加在一起称为一个端口&#xff0c;也就是说交换机的一个端口就相当于计算机上的一块网卡。 如果在计算机上安装多个网卡&#xff0c;并让网卡接收所有网络包&#xff0c;再安装具备交换机功能的软件&#xff0…...

【软件测试学习笔记2】用例设计方法

1.能对穷举场景设计测试点&#xff08;等价法&#xff09; 等价类&#xff1a; 说明&#xff1a;在所有测试数据中&#xff0c;具有某种共同特征的数据集合进行划分 分类&#xff1a;有效等价类&#xff1a;满足需求的数据集合 无效等价类&#xff1a;不满足需求的数据集合 步…...

蓝桥杯 第三场 小白入门赛

召唤神坤 有意思&#x1f914;&#xff08;ikun&#xff09;。虽然是第一题但也要配得上神坤的身份。 思路1 枚举分母&#xff0c;选择一个数据结构来选出分母两侧最大的两个数做分子。2s常数大些也无碍。我选择好写的ST表 思路2 写两个 d p dp dp 分别表示 1 1 1 到 i…...

网络安全等级保护测评规划与设计

笔者单位网络结构日益复杂&#xff0c;应用不断增多&#xff0c;使信息系统面临更多的风险。同时&#xff0c;网络攻防技术发展迅速&#xff0c;攻击的技术门槛随着自动化攻击工具的应用也在不断降低&#xff0c;勒索病毒等未知威胁也开始泛滥。基于此&#xff0c;笔者单位拟进…...

Error: Cannot find module ‘vue-template-compiler‘ 问题解决

启动Vuepress项目时报了如下错误&#xff1a;Error: Cannot find module vue-template-compiler Error: Cannot find module vue-template-compiler Require stack: - /usr/local/lib/node_modules/vuepress/node_modules/vue-loader/lib/compiler.js - /usr/local/lib/node_…...

华为认证云计算专家(HCIE-Cloud Computing)--练习题

华为认证云计算专家&#xff08;HCIE-Cloud Computing&#xff09;–练习题 1.(判断题)华为云stack支持鲲鹏架构&#xff0c;业务可从X86过渡到鲲鹏。 正确答案&#xff1a;正确 2.(判断题)业务上云以后&#xff0c;安全方面由云服务商负责&#xff0c;客户自己不需要做任何防…...

【MATLAB】【数字信号处理】产生系统的单位冲激响应h(t)与H(z)零极点分布

一、实验目的与要求 产生h(t) 与H(z) 零极点分布 二、实验仪器 微机&#xff0c;仿真软件MATLAB 2022a 三、实验内容与测试结果 1.已知描述连续系统的微分方程为y(t)5y(t)6y(t)2x(t)8x(t) &#xff0c;计算系统的单位冲激响应h(t) 程序如下&#xff1a; clear all; ts0;…...

ES6从入门到精通:前言

ES6简介 ES6&#xff08;ECMAScript 2015&#xff09;是JavaScript语言的重大更新&#xff0c;引入了许多新特性&#xff0c;包括语法糖、新数据类型、模块化支持等&#xff0c;显著提升了开发效率和代码可维护性。 核心知识点概览 变量声明 let 和 const 取代 var&#xf…...

java 实现excel文件转pdf | 无水印 | 无限制

文章目录 目录 文章目录 前言 1.项目远程仓库配置 2.pom文件引入相关依赖 3.代码破解 二、Excel转PDF 1.代码实现 2.Aspose.License.xml 授权文件 总结 前言 java处理excel转pdf一直没找到什么好用的免费jar包工具,自己手写的难度,恐怕高级程序员花费一年的事件,也…...

工业自动化时代的精准装配革新:迁移科技3D视觉系统如何重塑机器人定位装配

AI3D视觉的工业赋能者 迁移科技成立于2017年&#xff0c;作为行业领先的3D工业相机及视觉系统供应商&#xff0c;累计完成数亿元融资。其核心技术覆盖硬件设计、算法优化及软件集成&#xff0c;通过稳定、易用、高回报的AI3D视觉系统&#xff0c;为汽车、新能源、金属制造等行…...

精益数据分析(97/126):邮件营销与用户参与度的关键指标优化指南

精益数据分析&#xff08;97/126&#xff09;&#xff1a;邮件营销与用户参与度的关键指标优化指南 在数字化营销时代&#xff0c;邮件列表效度、用户参与度和网站性能等指标往往决定着创业公司的增长成败。今天&#xff0c;我们将深入解析邮件打开率、网站可用性、页面参与时…...

uniapp 字符包含的相关方法

在uniapp中&#xff0c;如果你想检查一个字符串是否包含另一个子字符串&#xff0c;你可以使用JavaScript中的includes()方法或者indexOf()方法。这两种方法都可以达到目的&#xff0c;但它们在处理方式和返回值上有所不同。 使用includes()方法 includes()方法用于判断一个字…...

Qt 事件处理中 return 的深入解析

Qt 事件处理中 return 的深入解析 在 Qt 事件处理中&#xff0c;return 语句的使用是另一个关键概念&#xff0c;它与 event->accept()/event->ignore() 密切相关但作用不同。让我们详细分析一下它们之间的关系和工作原理。 核心区别&#xff1a;不同层级的事件处理 方…...

【Veristand】Veristand环境安装教程-Linux RT / Windows

首先声明&#xff0c;此教程是针对Simulink编译模型并导入Veristand中编写的&#xff0c;同时需要注意的是老用户编译可能用的是Veristand Model Framework&#xff0c;那个是历史版本&#xff0c;且NI不会再维护&#xff0c;新版本编译支持为VeriStand Model Generation Suppo…...

Java详解LeetCode 热题 100(26):LeetCode 142. 环形链表 II(Linked List Cycle II)详解

文章目录 1. 题目描述1.1 链表节点定义 2. 理解题目2.1 问题可视化2.2 核心挑战 3. 解法一&#xff1a;HashSet 标记访问法3.1 算法思路3.2 Java代码实现3.3 详细执行过程演示3.4 执行结果示例3.5 复杂度分析3.6 优缺点分析 4. 解法二&#xff1a;Floyd 快慢指针法&#xff08;…...

从零开始了解数据采集(二十八)——制造业数字孪生

近年来&#xff0c;我国的工业领域正经历一场前所未有的数字化变革&#xff0c;从“双碳目标”到工业互联网平台的推广&#xff0c;国家政策和市场需求共同推动了制造业的升级。在这场变革中&#xff0c;数字孪生技术成为备受关注的关键工具&#xff0c;它不仅让企业“看见”设…...

Vue3 PC端 UI组件库我更推荐Naive UI

一、Vue3生态现状与UI库选择的重要性 随着Vue3的稳定发布和Composition API的广泛采用&#xff0c;前端开发者面临着UI组件库的重新选择。一个好的UI库不仅能提升开发效率&#xff0c;还能确保项目的长期可维护性。本文将对比三大主流Vue3 UI库&#xff08;Naive UI、Element …...