鸿蒙中自定义slider实现字体大小变化

ui:

import { display, mediaquery, router } from '@kit.ArkUI'
import CommonConstants from './CommonConstants';
import PreferencesUtil from './PreferencesUtil';
import StyleConstants from './StyleConstants';// 字体大小
@Entry
@Component
struct FontSize {@State TopBar: string[] = ['取消', '字体大小预览', '确定']@State sliderTitle: string[] = ['A', '标准', '', 'A']@State changeFontSize: number = 12;@State outSetValueOne: number = 40@State offsetX: number = 0;@State lineW: number = 0@State circleW: number = 18@State circleH: number = 18@State minW: number = 0@State scaleArr: number[] = []@State acrossOrVertical: string = ''aboutToAppear() {PreferencesUtil.getChangeFontSize().then((value) => {this.changeFontSize = value;if (this.changeFontSize === CommonConstants.SET_SIZE_EXTRA_LARGE) {this.offsetX = CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL} else if (this.changeFontSize === CommonConstants.SET_SIZE_LARGE) {this.offsetX = CommonConstants.SET_SCALE_LARGE_VERTICAL} else if (this.changeFontSize === CommonConstants.SET_SIZE_NORMAL) {this.offsetX = CommonConstants.SET_SCALE_NORMAL_VERTICAL} else if (this.changeFontSize === CommonConstants.SET_SIZE_SMALL) {this.offsetX = CommonConstants.SET_SCALE_SMALL_VERTICAL}});this.scaleArr = [CommonConstants.SET_SCALE_SMALL_VERTICAL, CommonConstants.SET_SCALE_NORMAL_VERTICAL,CommonConstants.SET_SCALE_LARGE_VERTICAL, CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL]this.lineW = CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL //pad竖屏}callbackOffset() {// if (this.offsetX === 18) {//   return 0 - this.circleW / 2// }return this.offsetX - this.circleW / 2}changeFontSize_Across() {if (this.offsetX > CommonConstants.SET_SCALE_SMALL_ACROSS &&this.offsetX <= CommonConstants.SET_SCALE_NORMAL_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS) {this.changeFontSize = CommonConstants.SET_SIZE_SMALL} else if (this.offsetX >CommonConstants.SET_SCALE_NORMAL_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS / 2 &&this.offsetX <= CommonConstants.SET_SCALE_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS) {this.changeFontSize = CommonConstants.SET_SIZE_NORMAL} else if (this.offsetX >CommonConstants.SET_SCALE_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS &&this.offsetX <=CommonConstants.SET_SCALE_EXTRA_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS) {this.changeFontSize = CommonConstants.SET_SIZE_LARGE} else if (this.offsetX >CommonConstants.SET_SCALE_EXTRA_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS &&this.offsetX <= CommonConstants.SET_SCALE_EXTRA_LARGE_ACROSS) {this.changeFontSize = CommonConstants.SET_SIZE_EXTRA_LARGE}}changeFontSize_Vertical() {if (this.offsetX > CommonConstants.SET_SCALE_SMALL_VERTICAL &&this.offsetX <=CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_SMALL} else if (this.offsetX >CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL / 2 &&this.offsetX <= CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_NORMAL} else if (this.offsetX >CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&this.offsetX <=CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_LARGE} else if (this.offsetX >CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&this.offsetX <= CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_EXTRA_LARGE}}onTouchGetOffsetX_Vertical(touchesX: number) {AlertDialog.show({ message: "1" })if (touchesX > CommonConstants.SET_SCALE_SMALL_VERTICAL && touchesX <CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_SMALL_VERTICAL}if (touchesX >CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&touchesX <CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_NORMAL_VERTICAL}if (touchesX >CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&touchesX <CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_LARGE_VERTICAL}if (touchesX >CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&touchesX < CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL}}onTouchGetOffsetX_Across(touchesX: number) {AlertDialog.show({ message: "2" })if (touchesX > CommonConstants.SET_SCALE_SMALL_ACROSS &&touchesX < CommonConstants.SET_SCALE_NORMAL_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS) {this.offsetX = CommonConstants.SET_SCALE_SMALL_ACROSS}if (touchesX > CommonConstants.SET_SCALE_NORMAL_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS &&touchesX < CommonConstants.SET_SCALE_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS) {this.offsetX = CommonConstants.SET_SCALE_NORMAL_ACROSS}if (touchesX > CommonConstants.SET_SCALE_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS &&touchesX < CommonConstants.SET_SCALE_EXTRA_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS) {this.offsetX = CommonConstants.SET_SCALE_LARGE_ACROSS}if (touchesX > CommonConstants.SET_SCALE_EXTRA_LARGE_ACROSS - CommonConstants.SET_SCALE_AVERAGE_ACROSS &&touchesX < CommonConstants.SET_SCALE_EXTRA_LARGE_ACROSS) {this.offsetX = CommonConstants.SET_SCALE_EXTRA_LARGE_ACROSS}}build() {Column() {Text('实例文案-----你猜你猜猜').fontSize(this.changeFontSize + StyleConstants.UNIT_FP)Text(`相应字体大小:${this.changeFontSize}`).fontSize(this.changeFontSize + StyleConstants.UNIT_FP)Text(`偏移距离:${this.offsetX}`).fontSize(this.changeFontSize + StyleConstants.UNIT_FP)Column() {Row() {ForEach(this.sliderTitle, (item: string, i: number) => {Text(item).fontSize(i === 3 ? 16 : 13)})}.width('91%').justifyContent(FlexAlign.SpaceBetween)Stack() {Row() {ForEach([1, 2, 3, 4], (item: number) => {Text().width(2).height(12).backgroundColor('#646464')})}.width(this.lineW).justifyContent(FlexAlign.SpaceBetween)Stack() {Line().width(this.lineW).height(2).backgroundColor('#646464')Text().width(this.circleW).height(this.circleH).borderRadius(9).backgroundColor(Color.White).border({ width: 3, color: "#646464" }).draggable(true).translate({ x: this.callbackOffset() })}.width('97%').height(50).alignContent(Alignment.Start).onTouch(async (event) => {this.offsetX = event.touches[0].xif (event.touches[0].x < this.circleW) {this.offsetX = this.circleW}if (event.touches[0].x > this.lineW) {this.offsetX = this.lineW}if (this.offsetX > CommonConstants.SET_SCALE_SMALL_VERTICAL &&this.offsetX <=CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_SMALL} else if (this.offsetX >CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL / 2 &&this.offsetX <= CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_NORMAL} else if (this.offsetX >CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&this.offsetX <=CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_LARGE} else if (this.offsetX >CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&this.offsetX <= CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL) {this.changeFontSize = CommonConstants.SET_SIZE_EXTRA_LARGE}// this.changeFontSize_Vertical()if (event.type === TouchType.Up) {if (event.touches[0].x > CommonConstants.SET_SCALE_SMALL_VERTICAL && event.touches[0].x <CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_SMALL_VERTICAL}if (event.touches[0].x >CommonConstants.SET_SCALE_NORMAL_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&event.touches[0].x <CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_NORMAL_VERTICAL}if (event.touches[0].x >CommonConstants.SET_SCALE_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&event.touches[0].x <CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_LARGE_VERTICAL}if (event.touches[0].x >CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL - CommonConstants.SET_SCALE_AVERAGE_VERTICAL &&event.touches[0].x < CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL) {this.offsetX = CommonConstants.SET_SCALE_EXTRA_LARGE_VERTICAL}}if (this.changeFontSize === 0) {this.changeFontSize = await PreferencesUtil.getChangeFontSize();return;}})}.width('93%')}.width('100%').height(48).margin({ bottom: 40, top: 5 })}.height('100%').width('100%')}
}

utils_GlobalContext:

/** Copyright (c) 2023 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.*/export class GlobalContext {private constructor() { }private static instance: GlobalContext;private _objects = new Map<string, Object>();public static getContext(): GlobalContext {if (!GlobalContext.instance) {GlobalContext.instance = new GlobalContext();}return GlobalContext.instance;}getObject(value: string): Object | undefined {return this._objects.get(value);}setObject(key: string, objectClass: Object): void {this._objects.set(key, objectClass);}
}

utils_CommonConstants:

/** 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.*//*** Common constants for all features.*/
export default class CommonConstants {// fontSizestatic readonly SET_SIZE_SMALL: number = 13.6;static readonly SET_SIZE_NORMAL: number = 16;static readonly SET_SIZE_LARGE: number = 18.4;static readonly SET_SIZE_EXTRA_LARGE: number = 20.8;//   scale_pad_verticalstatic readonly SET_SCALE_SMALL_VERTICAL: number = 0static readonly SET_SCALE_NORMAL_VERTICAL: number = 214static readonly SET_SCALE_LARGE_VERTICAL: number = 428static readonly SET_SCALE_EXTRA_LARGE_VERTICAL: number = 642static readonly SET_SCALE_AVERAGE_VERTICAL: number = 107//   scale_pad_acrossstatic readonly SET_SCALE_SMALL_ACROSS: number = 0static readonly SET_SCALE_NORMAL_ACROSS: number = 342static readonly SET_SCALE_LARGE_ACROSS: number = 684static readonly SET_SCALE_EXTRA_LARGE_ACROSS: number = 1026static readonly SET_SCALE_AVERAGE_ACROSS: number = 171
}

utils_PreferencesUtil:

/** 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 { preferences } from '@kit.ArkData';
import { GlobalContext } from './GlobalContext';const TAG = '[PreferencesUtil]';
const PREFERENCES_NAME = 'myPreferences';
const KEY_APP_FONT_SIZE = 'appFontSize';/*** The PreferencesUtil provides preferences of create, save and query.*/
export class PreferencesUtil {createFontPreferences(context: Context) {let fontPreferences: Function = (() => {let preference: Promise<preferences.Preferences> = preferences.getPreferences(context, PREFERENCES_NAME);return preference;});GlobalContext.getContext().setObject('getFontPreferences', fontPreferences);}saveDefaultFontSize(fontSize: number) {let getFontPreferences: Function = GlobalContext.getContext().getObject('getFontPreferences') as Function;getFontPreferences().then((preferences: preferences.Preferences) => {preferences.has(KEY_APP_FONT_SIZE).then(async (isExist: boolean) => {if (!isExist) {await preferences.put(KEY_APP_FONT_SIZE, fontSize);preferences.flush();}}).catch((err: Error) => {});}).catch((err: Error) => {});}saveChangeFontSize(fontSize: number) {let getFontPreferences: Function = GlobalContext.getContext().getObject('getFontPreferences') as Function;getFontPreferences().then(async (preferences: preferences.Preferences) => {await preferences.put(KEY_APP_FONT_SIZE, fontSize);preferences.flush();}).catch((err: Error) => {});}async getChangeFontSize() {let fontSize: number = 0;let getFontPreferences: Function = GlobalContext.getContext().getObject('getFontPreferences') as Function;// const preferences: dataPreferences.Preferences = await getFontPreferences();fontSize = await (await getFontPreferences()).get(KEY_APP_FONT_SIZE, fontSize);return fontSize;}async deleteChangeFontSize() {let getFontPreferences: Function = GlobalContext.getContext().getObject('getFontPreferences') as Function;const preferences: preferences.Preferences = await getFontPreferences();let deleteValue = preferences.delete(KEY_APP_FONT_SIZE);deleteValue.then(() => {}).catch((err: Error) => {});}
}export default new PreferencesUtil();

utils_StyleConstants:

/** 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.*//*** Style constants for all features.*/
export default class StyleConstants {/*** The head aspect ratio.*/static readonly HEAD_ASPECT_RATIO: number = 1;/*** Weight to fill.*/static readonly WEIGHT_FULL: number = 1;/*** Minimum height of two lines of text.*/static readonly DOUBLE_ROW_MIN: number = 28;/*** Unit of fp.*/static readonly UNIT_FP: string = 'fp';/*** Full the width.*/static readonly FULL_WIDTH: string = '100%';/*** Full the height.*/static readonly FULL_HEIGHT: string = '100%';/*** The percentage of 7.2.*/static readonly TITLE_BAR_HEIGHT_PERCENT: string = '7.2%';/*** The percentage of 93.3.*/static readonly BLOCK_WIDTH_PERCENT: string = '93.3%';/*** The percentage of 0.5.*/static readonly BLOCK_TOP_MARGIN_FIRST_PERCENT: string = '0.5%';/*** The percentage of 1.5.*/static readonly BLOCK_TOP_MARGIN_SECOND_PERCENT: string = '1.5%';/*** The percentage of 23.8.*/static readonly DIVIDER_END_MARGIN_PERCENT: string = '23.8%';/*** The percentage of 6.7.*/static readonly HEAD_RIGHT_PERCENT: string = '6.7%';/*** The percentage of 2.2.*/static readonly HEAD_LEFT_PERCENT: string = '2.2%';/*** The percentage of 64.4.*/static readonly MAX_CHAT_WIDTH_PERCENT: string = '64.4%';/*** The percentage of 3.1.*/static readonly CHAT_TOP_MARGIN_PERCENT: string = '3.1%';/*** The percentage of 6.5.*/static readonly SLIDER_LAYOUT_LEFT_PERCENT: string = '6.5%';/*** The percentage of 3.2.*/static readonly SLIDER_LAYOUT_TOP_PERCENT: string = '3.2%';/*** The percentage of 8.9.*/static readonly SET_CHAT_HEAD_SIZE_PERCENT: string = '8.9%';/*** The percentage of 12.5.*/static readonly A_WIDTH_PERCENT: string = '12.5%';/*** The percentage of 75.*/static readonly SLIDER_WIDTH_PERCENT: string = '75%';/*** The percentage of 3.3.*/static readonly SLIDER_HORIZONTAL_MARGIN_PERCENT: string = '3.3%';/*** The percentage of 1.*/static readonly SLIDER_TOP_MARGIN_PERCENT: string = '1%';/*** The percentage of 6.2.*/static readonly SLIDER_BOTTOM_MARGIN_PERCENT: string = '6.2%';
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/67077.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

SpringBoot多数据源架构实现

文章目录 1. 环境准备2. 创建Spring Boot项目3. 添加依赖4. 配置多数据源5. 配置MyBatis-Plus6. 使用多数据源7. 创建Mapper接口8. 实体类定义9. 测试多数据源10. 注意事项10.1 事务导致多数据源失效问题解决方案&#xff1a; 10.2 ClickHouse的事务支持10.3 数据源切换的性能开…

WPF 如何添加系统托盘

1.使用Nuget 添加 handycontrol cs xmlns:hc"https://handyorg.github.io/handycontrol" 2.窗体添加控件cs <hc:NotifyIcon x:Name"NotifyIconContextContent" Text"软件名称" ContextMenu"{StaticResource ContextMenu}" Click&…

LabVIEW智能水肥一体灌溉控制系统

本文详细介绍了一种基于LabVIEW的智能水肥一体灌溉控制系统的设计与实现。该系统采用模糊控制策略&#xff0c;能够自动调节土壤湿度和肥液浓度&#xff0c;满足不同作物在不同生长阶段的需求&#xff0c;有效提高水肥利用效率&#xff0c;对现代精准农业具有重要的实践和推广价…

【高可用自动化体系】自动化体系

架构设计的愿景就是高可用、高性能、高扩展、高效率。为了实现架构设计四高愿景&#xff0c;需要实现自动化系统目标&#xff1a; 标准化。 流程自助化。 可视化&#xff1a;可观测系统各项指标、包括全链路跟踪。 自动化&#xff1a;ci/cd 自动化部署。 精细化&#xff1a…

Python 实现数字三角形排列详解:Java 视角下的实现与分析

哈喽&#xff0c;各位小伙伴们&#xff0c;你们好呀&#xff0c;我是喵手。运营社区&#xff1a;C站/掘金/腾讯云/阿里云/华为云/51CTO&#xff1b;欢迎大家常来逛逛 今天我要给大家分享一些自己日常学习到的一些知识点&#xff0c;并以文字的形式跟大家一起交流&#xff0c;互…

Docker与虚拟机的区别及常用指令详解

在现代软件开发中&#xff0c;容器化和虚拟化技术已经成为不可或缺的工具。Docker和虚拟机&#xff08;VM&#xff09;是两种常见的技术&#xff0c; 它们都可以帮助开发者在不同的环境中运行应用程序。然而&#xff0c;它们的工作原理和使用场景有很大的不同。本文将详细探讨D…

【JVM-2.3】深入解析JVisualVM:Java性能监控与调优利器

在Java应用的开发和运维过程中&#xff0c;性能监控与调优是不可或缺的环节。无论是排查内存泄漏、分析CPU瓶颈&#xff0c;还是优化线程使用&#xff0c;开发者都需要借助一些强大的工具来辅助诊断。JVisualVM 正是这样一款由Oracle提供的免费工具&#xff0c;它集成了多种性能…

简聊MySQL并发事务中幻读、虚读问题的解决方案

在MySQL数据库中&#xff0c;事务的幻读和虚读问题是并发控制中的关键挑战。以下是针对这两个问题的解决方案及原理说明&#xff0c;并附上相关示例。 一、幻读问题及其解决方案 幻读问题的定义 幻读是指一个事务在前后两次查询同一个范围的时候&#xff0c;后一次查询看到了…

WINFORM - DevExpress -> gridcontrol ---->控件(ColumnEdit控件)

ImageComboBoxEdit--带图片的下拉菜单 DevExpress&#xff1a;带图片的下拉菜单ImageComboBoxEdit_weixin_34313182的博客-CSDN博客 ImageEdit--图片按钮 DevExpress控件中的gridcontrol表格控件&#xff0c;如何在属性中设置某一列显示为图片&#xff08;图片按钮&#xff…

IntelliJ IDEA Type Hierarchy Scope Pattern 学习指南

IntelliJ IDEA Type Hierarchy Scope Pattern 学习指南 什么是 Type Hierarchy&#xff1f; Type Hierarchy 是 IntelliJ IDEA 提供的一个工具&#xff0c;允许开发者查看某个类的继承关系及其实现的接口结构。它是理解类关系的重要工具&#xff0c;尤其在处理复杂的继承体系…

前端工具汇总

1. vscode 下载地址&#xff1a;https://code.visualstudio.com/ vscode扩展汇总&#xff1a; 1.1 Code Spell Checker&#xff08;必须安装&#xff09; 代码拼写检查器 1.2 Auto Close Tag 自动添加HTML/XML的关闭标签 3. Auto Import 自动查找、解析并为所有可用导入…

分布式ID的实现方案

1. 什么是分布式ID ​ 对于低访问量的系统来说&#xff0c;无需对数据库进行分库分表&#xff0c;单库单表完全可以应对&#xff0c;但是随着系统访问量的上升&#xff0c;单表单库的访问压力逐渐增大&#xff0c;这时候就需要采用分库分表的方案&#xff0c;来缓解压力。 ​…

Python爬虫-汽车之家各车系周销量榜数据

前言 本文是该专栏的第43篇,后面会持续分享python爬虫干货知识,记得关注。 在本专栏之前,笔者在文章《Python爬虫-汽车之家各车系月销量榜数据》中,有详细介绍,如何爬取“各车系车型的月销量榜单数据”的方法以及完整代码教学教程。 而本文,笔者同样以汽车之家平台为例,…

Unity-Mirror网络框架-从入门到精通之RigidbodyBenchmark示例

文章目录 前言示例代码逻辑测试结论性能影响因素最后前言 在现代游戏开发中,网络功能日益成为提升游戏体验的关键组成部分。本系列文章将为读者提供对Mirror网络框架的深入了解,涵盖从基础到高级的多个主题。Mirror是一个用于Unity的开源网络框架,专为多人游戏开发设计,它…

【STM32-学习笔记-7-】USART串口通信

文章目录 USART串口通信Ⅰ、硬件电路Ⅱ、常见的电平标准Ⅲ、串口参数及时序Ⅳ、STM32的USART简介数据帧起始位侦测数据采样波特率发生器 Ⅴ、USART函数介绍Ⅵ、USART_InitTypeDef结构体参数1、USART_BaudRate2、USART_WordLength3、USART_StopBits4、USART_Parity5、USART_Mode…

Linux简介和环境搭建

Linux 介绍和环境搭建 1、发行版本 Linux 操作系统有多个主流发行版本&#xff0c;每个版本根据不同的目标、特点和使用场景为用户提供了不同的功能和体验。 Ubuntu • 特点&#xff1a;Ubuntu 是最为人熟知的 Linux 发行版之一&#xff0c;强调易用性和用户友好性&#xff…

如何通过高防服务隐藏服务器源IP

在网络安全领域&#xff0c;隐藏服务器的真实源IP地址是保护服务器免受直接攻击的重要手段之一。暴露的源IP地址容易成为黑客攻击的目标&#xff0c;尤其是DDoS攻击、端口扫描和暴力破解等威胁。高防服务&#xff08;如阿里云盾、AWS Shield等&#xff09;不仅提供强大的流量清…

type1-100,2 words

dish n.餐具、碟&#xff0c;盘子&#xff1b;菜肴、饭菜&#xff08;指一顿餐食中的一道菜&#xff09; kind of 稍微&#xff1b;有点 sort of 稍微&#xff1b;有点儿 smallish adj.有点小的 crack 敲碎/裂&#xff0c;敲开&#xff0c;砸开&#xff0c;砸碎&#xff1b;裂开…

代码随想录刷题day07|(数组篇)58.区间和

目录 一、数组理论基础 二、前缀和 三、相关算法题目 四、总结 五、待解决问题 一、数组理论基础 数组是存放在连续内存空间上的相同类型数据的集合。 代码随想录 (programmercarl.com) 特点&#xff1a; 1.下标从0开始&#xff0c;内存中地址空间是连续的 2.查询快&…

多模态论文笔记——CLIP

大家好&#xff0c;这里是好评笔记&#xff0c;公主号&#xff1a;Goodnote&#xff0c;专栏文章私信限时Free。本文详细介绍这几年AIGC火爆的隐藏功臣&#xff0c;多模态模型&#xff1a;CLIP。 文章目录 CLIP&#xff08;Contrastive Language-Image Pre-training&#xff09…