JetpackCompose从入门到实战学习笔记8—ConstraintLayout的简单使用
JetpackCompose从入门到实战学习笔记8—ConstraintLayout的简单使用
1.简介:
Compose 中的 ConstraintLayout
ConstraintLayout
是一种布局,让您可以相对于屏幕上的其他可组合项来放置可组合项。它是一种实用的替代方案,可代替使用多个已嵌套的 Row
、Column
、Box
和其他自定义布局元素这种做法。在实现对齐要求比较复杂的较大布局时,ConstraintLayout
很有用。
在以下情况下,考虑使用 ConstraintLayout
:
- 为了避免在屏幕上定位元素时嵌套多个
Column
和Row
,以便提高代码的可读性。 - 相对于其它可组合项来定位可组合项,或根据引导线、屏障线或链来定位可组合项。
在 View 系统中,建议使用 ConstraintLayout
来创建复杂的大型布局,因为扁平视图层次结构比嵌套视图的效果更好。不过,这在 Compose 中不是什么问题,因为 Compose 能够高效地处理较深的布局层次结构。
2.在build.gradle中添加依赖:
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
3.可组合项简单使用:
@Composable
fun ConstraintLayoutContent() {ConstraintLayout {// Create references for the composables to constrainval (button, text) = createRefs()Button(onClick = { /* Do something */ },// Assign reference "button" to the Button composable// and constrain it to the top of the ConstraintLayoutmodifier = Modifier.constrainAs(button) {top.linkTo(parent.top, margin = 16.dp)}) {Text("Button")}// Assign reference "text" to the Text composable// and constrain it to the bottom of the Button composableText("Android", Modifier.constrainAs(text) {top.linkTo(button.bottom, margin = 16.dp)})}
}
4.效果如下:
5.Barrier分界线:
@Preview@Composablefun InputFieldLayoutDemo() {ConstraintLayout(modifier = Modifier.width(400.dp).height(100.dp).padding(10.dp)) {val (usernameTextRef, passwordTextRef, usernameInputRef, passWordInputRef, dividerRef) = remember { createRefs() }var barrier = createEndBarrier(usernameTextRef, passwordTextRef)Text(text = "用户名",fontSize = 14.sp,textAlign = TextAlign.Left,modifier = Modifier.constrainAs(usernameTextRef) {top.linkTo(parent.top)start.linkTo(parent.start)})Divider(Modifier.fillMaxWidth().constrainAs(dividerRef) {top.linkTo(usernameTextRef.bottom)bottom.linkTo(passwordTextRef.top)})Text(text = "密码",fontSize = 14.sp,modifier = Modifier.constrainAs(passwordTextRef) {top.linkTo(usernameTextRef.bottom, 19.dp)start.linkTo(parent.start)})OutlinedTextField(value = "",onValueChange = {},modifier = Modifier.constrainAs(usernameInputRef) {start.linkTo(barrier, 10.dp)top.linkTo(usernameTextRef.top)bottom.linkTo(usernameTextRef.bottom)height = Dimension.fillToConstraints})OutlinedTextField(value = "",onValueChange = {},modifier = Modifier.constrainAs(passWordInputRef) {start.linkTo(barrier, 10.dp)top.linkTo(passwordTextRef.top)bottom.linkTo(passwordTextRef.bottom)height = Dimension.fillToConstraints})}}
6.效果如下:
7.GuideLine引导线:
@Preview@Composablefun GuidelineSample(){ConstraintLayout(modifier = Modifier.fillMaxSize().padding(10.dp).background(Color.White)) {val topGuideline = createGuidelineFromTop(0.2f)var (userPortraitBackgroundRef, userPortraitImgRef, welcomeRef, quotesRef) = remember { createRefs() }Box(modifier = Modifier.background(Color.Green).constrainAs(userPortraitBackgroundRef) {top.linkTo(parent.top)bottom.linkTo(topGuideline)height = Dimension.fillToConstraintswidth = Dimension.matchParent})Image(painter = painterResource(id = R.mipmap.avatar),contentDescription = stringResource(R.string.description),contentScale = ContentScale.Crop,modifier = Modifier.constrainAs(userPortraitImgRef){top.linkTo(topGuideline)bottom.linkTo(topGuideline)start.linkTo(parent.start)end.linkTo(parent.end)}.size(100.dp).clip(CircleShape).border(width = 2.dp, color = Color.Red, shape = CircleShape))Text(text = "Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose ",fontSize = 24.sp,maxLines = 1,textAlign = TextAlign.Center,overflow = TextOverflow.Ellipsis,//1行显示不下时是否显示。。。modifier = Modifier.constrainAs(welcomeRef) {top.linkTo(userPortraitImgRef.bottom, 30.dp)start.linkTo(parent.start)end.linkTo(parent.end)width = Dimension.preferredWrapContent})}}//这里有个小技巧:若要想TextView一行铺满但没有完全显示且显示。。。时设置 overflow = TextOverflow.Ellipsis属性
8.效果如下:
9.Chain链接约束:
/*** Chain链接约束,Compose提供了ChainStyle* 1.Spread:链条中美国元素均分整个parent空间。* 2.SpreadInside:链条中首尾元素紧贴边界,剩下每个元素平分整个parent空间。* 3.Packed:链条在所有元素聚焦到中间。*/@Preview@Composablefun ChainDemo() {ConstraintLayout(modifier = Modifier.fillMaxSize().background(Color.Gray)) {val (quotesFirstLineRef, quotesSecondLineRef, quotesThirdLineRef, quotesForthLineRef) = remember { createRefs() }createVerticalChain(quotesFirstLineRef, quotesSecondLineRef, quotesThirdLineRef, quotesForthLineRef,chainStyle = ChainStyle.SpreadInside)Text(text = "寄蜉蝣于天地,",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesFirstLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})Text(text = "渺沧海之一粟。",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesSecondLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})Text(text = "哀吾生之须臾,",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesThirdLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})Text(text = "羡长江之无穷。",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesForthLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})}}
10.Spread模式效果如下:
- Spread模式:链条中美国元素均分整个parent空间。
11.SpreadInside模式效果如下:
- SpreadInside:链条中首尾元素紧贴边界,剩下每个元素平分整个parent空间。
12.Packed模式效果如下:
- Packed:链条在所有元素聚焦到中间。
13.完整代码如下:
import android.os.Bundle
import android.widget.ScrollView
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.constraintlayout.compose.ChainStyle
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension/*** @auth: njb* @date: 2023/1/17 16:36* @desc:*/
class ConstraintLayoutActivity:ComponentActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContent {// ConstraintLayoutContent()// ConstraintLayoutSample()//InputFieldLayoutDemo()//GuidelineSample()ChainDemo()}}@Preview@Composablefun ConstraintLayoutContent() {ConstraintLayout {// Create references for the composables to constrainval (button, text) = createRefs()Button(onClick = { /* Do something */ },// Assign reference "button" to the Button composable// and constrain it to the top of the ConstraintLayoutmodifier = Modifier.constrainAs(button) {top.linkTo(parent.top, margin = 16.dp)}) {Text("Button")}// Assign reference "text" to the Text composable// and constrain it to the bottom of the Button composableText("Android", Modifier.constrainAs(text) {top.linkTo(button.bottom, margin = 16.dp)})}}@Preview@Composablefun ConstraintLayoutSample(){ConstraintLayout(modifier = Modifier.width(400.dp).height(300.dp).padding(10.dp)) {// Create references for the composables to constrainval (button, text) = createRefs()Button(onClick = { },// Assign reference "button" to the Button composable// and constrain it to the top of the ConstraintLayoutmodifier = Modifier.constrainAs(button) {top.linkTo(parent.top, margin = 6.dp)}) {Text("Button")}// Assign reference "text" to the Text composable// and constrain it to the bottom of the Button composableText("Android", Modifier.constrainAs(text) {top.linkTo(button.bottom, margin = 6.dp)})val (portraitImageRef, usernameTextRef, desTextRef) = remember { createRefs() }Image(painter = painterResource(id = R.mipmap.avatar),contentDescription = stringResource(R.string.description),contentScale = ContentScale.Crop,modifier = Modifier.constrainAs(portraitImageRef){top.linkTo(parent.top)bottom.linkTo(parent.bottom)}.size(100.dp))Text(text = "Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose ",fontSize = 14.sp,maxLines = 1,textAlign = TextAlign.Center,overflow = TextOverflow.Ellipsis,//1行显示不下时是否显示。。。modifier = Modifier.constrainAs(usernameTextRef) {top.linkTo(portraitImageRef.top)start.linkTo(portraitImageRef.end, 10.dp)end.linkTo(parent.end, 10.dp)width = Dimension.preferredWrapContent})Text(text = "我的个人描述...",fontSize = 14.sp,color = Color.Red,fontWeight = FontWeight.Light,modifier = Modifier.constrainAs(desTextRef) {top.linkTo(usernameTextRef.bottom, 5.dp)start.linkTo(portraitImageRef.end, 10.dp)})}}@Preview@Composablefun GuidelineSample(){ConstraintLayout(modifier = Modifier.fillMaxSize().padding(10.dp).background(Color.White)) {val topGuideline = createGuidelineFromTop(0.2f)var (userPortraitBackgroundRef, userPortraitImgRef, welcomeRef, quotesRef) = remember { createRefs() }Box(modifier = Modifier.background(Color.Green).constrainAs(userPortraitBackgroundRef) {top.linkTo(parent.top)bottom.linkTo(topGuideline)height = Dimension.fillToConstraintswidth = Dimension.matchParent})Image(painter = painterResource(id = R.mipmap.avatar),contentDescription = stringResource(R.string.description),contentScale = ContentScale.Crop,modifier = Modifier.constrainAs(userPortraitImgRef){top.linkTo(topGuideline)bottom.linkTo(topGuideline)start.linkTo(parent.start)end.linkTo(parent.end)}.size(100.dp).clip(CircleShape).border(width = 2.dp, color = Color.Red, shape = CircleShape))Text(text = "Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose 技术爱好者Compose ",fontSize = 24.sp,maxLines = 1,textAlign = TextAlign.Center,overflow = TextOverflow.Ellipsis,//1行显示不下时是否显示。。。modifier = Modifier.constrainAs(welcomeRef) {top.linkTo(userPortraitImgRef.bottom, 30.dp)start.linkTo(parent.start)end.linkTo(parent.end)width = Dimension.preferredWrapContent})}}@Preview@Composablefun InputFieldLayoutDemo() {ConstraintLayout(modifier = Modifier.width(400.dp).height(100.dp).padding(10.dp)) {val (usernameTextRef, passwordTextRef, usernameInputRef, passWordInputRef, dividerRef) = remember { createRefs() }var barrier = createEndBarrier(usernameTextRef, passwordTextRef)Text(text = "用户名",fontSize = 14.sp,textAlign = TextAlign.Left,modifier = Modifier.constrainAs(usernameTextRef) {top.linkTo(parent.top)start.linkTo(parent.start)})Divider(Modifier.fillMaxWidth().constrainAs(dividerRef) {top.linkTo(usernameTextRef.bottom)bottom.linkTo(passwordTextRef.top)})Text(text = "密码",fontSize = 14.sp,modifier = Modifier.constrainAs(passwordTextRef) {top.linkTo(usernameTextRef.bottom, 19.dp)start.linkTo(parent.start)})OutlinedTextField(value = "",onValueChange = {},modifier = Modifier.constrainAs(usernameInputRef) {start.linkTo(barrier, 10.dp)top.linkTo(usernameTextRef.top)bottom.linkTo(usernameTextRef.bottom)height = Dimension.fillToConstraints})OutlinedTextField(value = "",onValueChange = {},modifier = Modifier.constrainAs(passWordInputRef) {start.linkTo(barrier, 10.dp)top.linkTo(passwordTextRef.top)bottom.linkTo(passwordTextRef.bottom)height = Dimension.fillToConstraints})}}/*** Chain链接约束,Compose提供了ChainStyle* 1.Spread:链条中美国元素均分整个parent空间* 2.SpreadInside:* 3.Packed:*/@Preview@Composablefun ChainDemo() {ConstraintLayout(modifier = Modifier.fillMaxSize().background(Color.Gray)) {val (quotesFirstLineRef, quotesSecondLineRef, quotesThirdLineRef, quotesForthLineRef) = remember { createRefs() }createVerticalChain(quotesFirstLineRef, quotesSecondLineRef, quotesThirdLineRef, quotesForthLineRef,chainStyle = ChainStyle.Packed)Text(text = "寄蜉蝣于天地,",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesFirstLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})Text(text = "渺沧海之一粟。",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesSecondLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})Text(text = "哀吾生之须臾,",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesThirdLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})Text(text = "羡长江之无穷。",color = Color.White,fontSize = 30.sp,fontWeight = FontWeight.Bold,modifier = Modifier.constrainAs(quotesForthLineRef) {start.linkTo(parent.start)end.linkTo(parent.end)})}}
}
14.完整效果预览如下:
相关文章:

JetpackCompose从入门到实战学习笔记8—ConstraintLayout的简单使用
JetpackCompose从入门到实战学习笔记8—ConstraintLayout的简单使用 1.简介: Compose 中的 ConstraintLayout ConstraintLayout 是一种布局,让您可以相对于屏幕上的其他可组合项来放置可组合项。它是一种实用的替代方案,可代替使用多个已嵌…...

Spring Boot 快速入门(绝对经典)
目录 1、理论概述 1.1、什么是Spring Boot? 1.2、Spring Boot的特点 1.3、开发环境 2、实战——创建和配置项目 2.1、Spring Boot项目创建的两种方式 2.1.1、方法一:通过网站构建项目 2.1.2、使用Spring Initializr创建(推荐) 2.2、…...
golang context上下文
文章目录一、为什么需要context二、context 接口三、Background 方法四、 with 系列函数1、WithCancel 方法2、WithDeadline 方法3、WithTimeout 方法4、WithValue 方法五、使用注意事项一、为什么需要context 在 Go http包的Server中,每一个请求在都有一个对应的 …...

Linux---Linux是什么
Linux 便成立的核心网站: http://www.kernel.org Linux是什么 Linux 就是一套操作系统 Linux 就是核心与系统呼叫接口那两层 软件移植:如果能够参考硬件的功能函数并据以修改你的操作系统程序代码, 那经过改版后的操作系统就能够在另一个硬…...

C语言(Tgmath.h库(C99),exit和atexit)
一.Tgmath.h库(C99) C99标准提供得tgmath.h头文件定义了泛型类型宏。比如在math.h中为一个函数定义了3中类型(float,double和long double)的版本,那么tgmath.h文件就创建一个泛型类型宏,与原来的float,double和long double版本的…...
LeetCode 刷题系列 -- 739. 每日温度
给定一个整数数组 temperatures ,表示每天的温度,返回一个数组 answer ,其中 answer[i] 是指对于第 i 天,下一个更高温度出现在几天后。如果气温在这之后都不会升高,请在该位置用 0 来代替。示例 1:输入:temperatures …...

如何生成毕业论文的目录和创建模板
有粉丝同学最近在写毕业论文,其中比较让人恼火的是毕业论文的目录,折腾了几遍没弄好,想让我写个简单地教程,那就来吧。主要分为三步:第一步是从模板里面提取标题的样式,第二步是对自己的论文使用设置好的标…...

新来的23岁软件测试员上来秀了波操作,把几个老员工看傻了
春招了,公司来了个小伙子,一看简历,嘿?22岁,这不刚毕业的小毛孩子嘛,结果没想到人家上来就把现有项目的性能优化了一遍,给公司节省了一半的成本,这种“王炸”打法,直接给…...

Window10开放某个端口
需求:由于防火墙原因,开放某个端口:如9999 在开始那里搜索防火墙-进入防火墙 第一步:核实是否启动了防火墙,之后进行 第二步:点击“高级设置”,→“入站规则”→“新建规则”→“端口”→ “下一步” …...
进阶7 分页查询
进阶7 分页查询!!! 目录概述练习题概述 应用场景:当要显示的数据一页显示不全,需要分页提交SQL请求 语法: select 查询列表 from 表名 【join type join 表2 on 连接条件 where 筛选条件 group by 分组字段…...

利用升序定时器链表处理非活动连接
参考自游双《Linux高性能服务器编程》 背景 服务器同常需要定期处理非活动连接:给客户发一个重连请求,或关闭该连接,或者其他。我们可以通过使用升序定时器链表处理非活动连接,下面的代码利用alarm函数周期性的触发SIGALRM信号&a…...
MySQL 开发规范
一、数据库命名规范所有数据对象名称必须小写 :db_user禁止使用MySQL 保留关键字,若是则引用 临时表以tmp_ 开头,备份表以bak_ 开头并以时间戳结尾所有存储相同数据的列名和列类型必须一致二、数据库基本设计规范1、MySQL…...

【C语言进阶】预处理与程序环境
目录一.详解编译与链接1.前言2.翻译环境3.剖析编译过程4.运行环境二.预处理详解1.预定义符号2.剖析#define(1).定义标识符(2).定义宏(3).替换规则(4).#和##(5).宏与函数的对比(6).#undef3.条件编译4.文件包含(1).头文件包含的方式(2).嵌套文件包含一.详解编译与链接 1.前言 在…...
【Docker知识】将环境变量传递到容器
一、说明 程序通常通过与软件捆绑在一起的配置来控制操作,环境变量允许用户在运行时设置它们。但是,在 Docker 容器中运行进程会使事情变得复杂,那么如何将环境变量传递给容器呢?下面介绍若干个传递办法。 二、环境变量有何用途 环…...

Allegro如何更改铜皮显示密度操作指导
Allegro如何更改铜皮显示密度操作指导 用Allegro做PCB设计的时候,铜皮正常显示模式如下图 铜皮的密度是基本填充满的,Allegro支持更改铜皮的显示密度 如下图 如何更改密度,具体操作如下 点击setup...

ThinkPHP5酒店预订管理系统
有需要请私信或看评论链接哦 可远程调试 ThinkPHP5酒店预订管理系统一 介绍 此酒店预订管理系统基于ThinkPHP5框架开发,数据库mysql,采用了ueditor富文本编辑器。系统角色分为用户,员工和管理员。用户可注册登录并预订酒店和评论等ÿ…...

【MySQL】MyCat分库分表分片规则配置详解与实战(MySQL专栏启动)
📫作者简介:小明java问道之路,2022年度博客之星全国TOP3,专注于后端、中间件、计算机底层、架构设计演进与稳定性建工设优化。文章内容兼具广度深度、大厂技术方案,对待技术喜欢推理加验证,就职于知名金融公…...

OpenWrt路由器设置域名动态解析手把手教程
文章目录0、前言1、准备工作2、详细步骤2.1、OpenWrt路由器软件包安装2.2、防火墙放行入站数据(修改为“接受”并保存应用)2.3、域名解析服务商对域名的解析设置2.4、路由器中动态域名插件的设置0、前言 因为一直用着内网穿透(zerotier或者是…...

java流浪动物救助系统(毕业设计)
项目类型:Java web项目/Java EE项目(非开源) 项目名称:基于JSPServlet的流浪动物救助网站[dwjz_web] 进行源码获取 用户类型:双角色(爱心人士、管理员) 项目架构:B/S架构 设计思…...

阿里代码规范插件中,Apache Beanutils为什么被禁止使用?
在实际的项目开发中,对象间赋值普遍存在,随着双十一、秒杀等电商过程愈加复杂,数据量也在不断攀升,效率问题,浮出水面。 问:如果是你来写对象间赋值的代码,你会怎么做? 答…...
React 第五十五节 Router 中 useAsyncError的使用详解
前言 useAsyncError 是 React Router v6.4 引入的一个钩子,用于处理异步操作(如数据加载)中的错误。下面我将详细解释其用途并提供代码示例。 一、useAsyncError 用途 处理异步错误:捕获在 loader 或 action 中发生的异步错误替…...

《从零掌握MIPI CSI-2: 协议精解与FPGA摄像头开发实战》-- CSI-2 协议详细解析 (一)
CSI-2 协议详细解析 (一) 1. CSI-2层定义(CSI-2 Layer Definitions) 分层结构 :CSI-2协议分为6层: 物理层(PHY Layer) : 定义电气特性、时钟机制和传输介质(导线&#…...

抖音增长新引擎:品融电商,一站式全案代运营领跑者
抖音增长新引擎:品融电商,一站式全案代运营领跑者 在抖音这个日活超7亿的流量汪洋中,品牌如何破浪前行?自建团队成本高、效果难控;碎片化运营又难成合力——这正是许多企业面临的增长困局。品融电商以「抖音全案代运营…...
数据链路层的主要功能是什么
数据链路层(OSI模型第2层)的核心功能是在相邻网络节点(如交换机、主机)间提供可靠的数据帧传输服务,主要职责包括: 🔑 核心功能详解: 帧封装与解封装 封装: 将网络层下发…...

论文浅尝 | 基于判别指令微调生成式大语言模型的知识图谱补全方法(ISWC2024)
笔记整理:刘治强,浙江大学硕士生,研究方向为知识图谱表示学习,大语言模型 论文链接:http://arxiv.org/abs/2407.16127 发表会议:ISWC 2024 1. 动机 传统的知识图谱补全(KGC)模型通过…...
Matlab | matlab常用命令总结
常用命令 一、 基础操作与环境二、 矩阵与数组操作(核心)三、 绘图与可视化四、 编程与控制流五、 符号计算 (Symbolic Math Toolbox)六、 文件与数据 I/O七、 常用函数类别重要提示这是一份 MATLAB 常用命令和功能的总结,涵盖了基础操作、矩阵运算、绘图、编程和文件处理等…...

k8s业务程序联调工具-KtConnect
概述 原理 工具作用是建立了一个从本地到集群的单向VPN,根据VPN原理,打通两个内网必然需要借助一个公共中继节点,ktconnect工具巧妙的利用k8s原生的portforward能力,简化了建立连接的过程,apiserver间接起到了中继节…...

有限自动机到正规文法转换器v1.0
1 项目简介 这是一个功能强大的有限自动机(Finite Automaton, FA)到正规文法(Regular Grammar)转换器,它配备了一个直观且完整的图形用户界面,使用户能够轻松地进行操作和观察。该程序基于编译原理中的经典…...

佰力博科技与您探讨热释电测量的几种方法
热释电的测量主要涉及热释电系数的测定,这是表征热释电材料性能的重要参数。热释电系数的测量方法主要包括静态法、动态法和积分电荷法。其中,积分电荷法最为常用,其原理是通过测量在电容器上积累的热释电电荷,从而确定热释电系数…...

技术栈RabbitMq的介绍和使用
目录 1. 什么是消息队列?2. 消息队列的优点3. RabbitMQ 消息队列概述4. RabbitMQ 安装5. Exchange 四种类型5.1 direct 精准匹配5.2 fanout 广播5.3 topic 正则匹配 6. RabbitMQ 队列模式6.1 简单队列模式6.2 工作队列模式6.3 发布/订阅模式6.4 路由模式6.5 主题模式…...