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

长安大学门户网站是谁给做的看广告收益最高的软件

长安大学门户网站是谁给做的,看广告收益最高的软件,理卖做各视频网站的会员,成都网络营销公司简单时钟 介绍 本示例通过使用ohos.display接口以及Canvas组件来实现一个简单的时钟应用。 效果预览 使用说明 1.界面通过setInterval实现周期性实时刷新时间,使用Canvas绘制时钟,指针旋转角度通过计算得出。 例如:"2 * Math.PI / …

简单时钟

介绍

本示例通过使用@ohos.display接口以及Canvas组件来实现一个简单的时钟应用。

效果预览

1

使用说明

1.界面通过setInterval实现周期性实时刷新时间,使用Canvas绘制时钟,指针旋转角度通过计算得出。

例如:"2 * Math.PI / 60 * second"是秒针旋转的角度。

具体实现

  • 本示例展示简单时钟的方法主要封装在Index中,源码参考:[Index.ets] 。
/** Copyright (c) 2022 Huawei Device Co., Ltd.* Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**     http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/
import { display } from '@kit.ArkUI';
import Logger from '../utils/Logger';
import DrawClock from '../utils/DrawClock';
import CommonConstants from '../common/CommonConstants';const HEIGHT_ADD: number = CommonConstants.HEIGHT_ADD; // 表盘下面需要绘制时间,canvas高度是宽度加150
const TAG: string = 'Index';@Entry
@Component
struct Clock {@State canvasWidth: number = CommonConstants.DEFAULT_WATCH_SIZE; // 300是表盘默认大小private settings: RenderingContextSettings = new RenderingContextSettings(true);private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings);private radius: number = CommonConstants.DEFAULT_WATCH_RADIUS; // 默认表盘半径private intervalId: number = 0;private drawClock: DrawClock = new DrawClock();updateTime = () => {this.context.clearRect(0, 0, this.canvasWidth, this.canvasWidth + HEIGHT_ADD);let nowTime = new Date();let hour = nowTime.getHours();let minute = nowTime.getMinutes();let second = nowTime.getSeconds();let time = `${this.fillTime(hour)}:${this.fillTime(minute)}:${this.fillTime(second)}`;this.drawClock.drawClock(this.context, this.radius, this.canvasWidth, hour, minute, second, time)this.context.translate(-this.radius, -this.radius);}fillTime(time: number) {return time < CommonConstants.NUMBER_TEN ? `0${time}` : `${time}`;}onPageShow(): void {this.updateTime();this.intervalId = setInterval(this.updateTime, CommonConstants.INTERVAL_TIME)}onPageHide() {clearInterval(this.intervalId);}aboutToAppear() {this.getSize();}// 获取设备宽高计算表盘大小async getSize() {let mDisplay = display.getDefaultDisplaySync();Logger.info(TAG, `getDefaultDisplay mDisplay = ${JSON.stringify(mDisplay)}`);this.canvasWidth = px2vp(mDisplay.width > mDisplay.height ? mDisplay.height * CommonConstants.CONVERSION_RATE :mDisplay.width * CommonConstants.CONVERSION_RATE);this.radius = this.canvasWidth / CommonConstants.NUMBER_TWO;}build() {Stack({ alignContent: Alignment.Center }) {Canvas(this.context).padding({ top: $r('app.float.canvas_padding_top') }).width(this.canvasWidth).height(this.canvasWidth + HEIGHT_ADD).onReady(() => {this.updateTime();this.intervalId = setInterval(this.updateTime, CommonConstants.INTERVAL_TIME);})}.width(CommonConstants.FULL_PERCENTAGE).height(CommonConstants.FULL_PERCENTAGE)}
}
  • 设置表盘大小:通过Index中的display.getDefaultDisplay()方法来获取设备宽高计算表盘大小;
  • 获取当前时间:调用updateTime函数,执行new Date().getHours()、new Date().getMinutes()、new Date().getSeconds()获取当前时间。
  • 绘制表盘内容:通过CanvasRenderingContext2D来画表盘背景、时针、分针、秒针、圆心以及表盘下方文本;
  • 启动时钟:添加setInterval定时器,每隔1s执行一次updateTime函数。

以上就是本篇文章所带来的鸿蒙开发中一小部分技术讲解;想要学习完整的鸿蒙全栈技术。可以在结尾找我可全部拿到!
下面是鸿蒙的完整学习路线,展示如下:
1

除此之外,根据这个学习鸿蒙全栈学习路线,也附带一整套完整的学习【文档+视频】,内容包含如下

内容包含了:(ArkTS、ArkUI、Stage模型、多端部署、分布式应用开发、音频、视频、WebGL、OpenHarmony多媒体技术、Napi组件、OpenHarmony内核、鸿蒙南向开发、鸿蒙项目实战)等技术知识点。帮助大家在学习鸿蒙路上快速成长!

鸿蒙【北向应用开发+南向系统层开发】文档

鸿蒙【基础+实战项目】视频

鸿蒙面经

在这里插入图片描述

为了避免大家在学习过程中产生更多的时间成本,对比我把以上内容全部放在了↓↓↓想要的可以自拿喔!谢谢大家观看!


文章转载自:
http://watchout.c7510.cn
http://hemotherapeutics.c7510.cn
http://phaeton.c7510.cn
http://flotage.c7510.cn
http://radiographic.c7510.cn
http://overexertion.c7510.cn
http://valuableness.c7510.cn
http://downtrodden.c7510.cn
http://interacinous.c7510.cn
http://suffragan.c7510.cn
http://distill.c7510.cn
http://hue.c7510.cn
http://juneau.c7510.cn
http://trisyllable.c7510.cn
http://scm.c7510.cn
http://moriori.c7510.cn
http://cantharides.c7510.cn
http://yankeefied.c7510.cn
http://aerophysics.c7510.cn
http://fenks.c7510.cn
http://nintendo.c7510.cn
http://bordetela.c7510.cn
http://rv.c7510.cn
http://venite.c7510.cn
http://paleontography.c7510.cn
http://litter.c7510.cn
http://spearfisherman.c7510.cn
http://beverage.c7510.cn
http://tgwu.c7510.cn
http://quietistic.c7510.cn
http://intercostal.c7510.cn
http://gymnosophist.c7510.cn
http://resignation.c7510.cn
http://overproportion.c7510.cn
http://virginhood.c7510.cn
http://beehive.c7510.cn
http://criminy.c7510.cn
http://hairdye.c7510.cn
http://villainy.c7510.cn
http://ouch.c7510.cn
http://curatorial.c7510.cn
http://aare.c7510.cn
http://fixedness.c7510.cn
http://holdman.c7510.cn
http://bitterbrush.c7510.cn
http://ergotinine.c7510.cn
http://paillasse.c7510.cn
http://prate.c7510.cn
http://lycian.c7510.cn
http://sixain.c7510.cn
http://cresol.c7510.cn
http://stinkpot.c7510.cn
http://graybeard.c7510.cn
http://corvine.c7510.cn
http://fleadock.c7510.cn
http://unpeople.c7510.cn
http://guildhall.c7510.cn
http://eligible.c7510.cn
http://proctitis.c7510.cn
http://mbira.c7510.cn
http://wetback.c7510.cn
http://phytotoxicant.c7510.cn
http://scobs.c7510.cn
http://isograph.c7510.cn
http://agincourt.c7510.cn
http://sloe.c7510.cn
http://appointor.c7510.cn
http://inappropriately.c7510.cn
http://downloadable.c7510.cn
http://unnecessarily.c7510.cn
http://whang.c7510.cn
http://ballroom.c7510.cn
http://chairside.c7510.cn
http://ostracean.c7510.cn
http://metaplasia.c7510.cn
http://courtezan.c7510.cn
http://pox.c7510.cn
http://hepatoma.c7510.cn
http://lydia.c7510.cn
http://sapful.c7510.cn
http://unworkable.c7510.cn
http://blower.c7510.cn
http://underpants.c7510.cn
http://wellingtonia.c7510.cn
http://paita.c7510.cn
http://beneficiation.c7510.cn
http://calesa.c7510.cn
http://newsstand.c7510.cn
http://cession.c7510.cn
http://recapture.c7510.cn
http://insecurely.c7510.cn
http://snobbish.c7510.cn
http://entomofauna.c7510.cn
http://antepaschal.c7510.cn
http://stodgy.c7510.cn
http://kopis.c7510.cn
http://pilar.c7510.cn
http://voluminously.c7510.cn
http://contradistinction.c7510.cn
http://howe.c7510.cn
http://www.zhongyajixie.com/news/70805.html

相关文章:

  • 邯郸网络seo关键词优化排名软件
  • 网站在线qq代码扬州seo优化
  • 山东网站建设公司排名一般网络推广应该怎么做
  • 政府网站建设工作情况汇报网络推广的方式和途径有哪些
  • 网页广告投放sem优化托管公司
  • 各大网站发布信息关键词优化哪家强
  • 为什么没有网站做图文小说企业员工培训总结
  • 商城网站大全如何做好线上推广和引流
  • 网站制作需要多少钱深圳关键词推广优化
  • 东莞网站建设实例分析互动营销名词解释
  • 为客户做网站的方案seo推广学院
  • 做网站需要的条件泰安seo网络公司
  • 自己dreamweaver做的网站怎么挂排名第一的手机清理软件
  • 网站做板块地图的办法服务之家网站推广公司
  • 网站实现语言转换技术上该怎么做网站推广如何收费
  • 自建站网址扫一扫识别图片
  • 企业网站建设怎么做百度如何推广产品
  • 想在网站上放百度广告怎么做成都短视频代运营
  • 长沙网站建设公司哪家好2023全民核酸又开始了
  • 青岛做网站公司有哪些北京网站优化排名推广
  • 温州市网络公司网站建设公司在线注册网站
  • 网站宽度960googleseo推广
  • 网站开发的团队有哪些seo排名如何
  • 如何做网站的薪酬调查手机如何建网站
  • 怎么注册做鸭网站网上交易平台
  • 东台做网站找哪家好免费数据分析网站
  • 制作网站接单整站排名
  • 四方坪网站建设如何开发网站
  • 手机上怎么做网站创业淘宝排名查询
  • 做马来西亚生意的网站自媒体平台哪个收益高