Android常用组件

目录

1. TextView 控件

常用属性:

1)android:text:

2)android:gravity:

3)android:textSize:

4)android:textColor:

5)android:background:

6)android:padding:

7)android:layout_width 和 android:layout_height:

8)android:maxLines:

9)android:ellipsize:

案例:TextView的简单使用

1.代码

​编辑

2.效果

2. EditText 控件

常用属性:

1)android:hint:

2)android:inputType:

3)android:maxLength:

4)android:password:

5)android:lines 和 android:minLines:

6)android:drawableLeft, ...Right, ...Top, ...Bottom:

案例:EditText控件的使用

1.代码

2.效果

3. Button 控件

常用属性:

1)android:text:

2)android:onClick:

3)android:background:

4)android:enabled:

5)android:visibility:

6)android:padding:

7)android:drawableLeft, ...Right, ...Top, ...Bottom:

案例:按钮控件的简单使用

1.代码

1布局文件代码

2.java代码

2.效果

4. ImageView 控件

常用属性:

1)android:src:

2)android:scaleType:

3)android:adjustViewBounds:

4)android:contentDescription:

案例:图片切换

1.代码

布局文件代码

2-java代码

2.效果

5. RadioButton 控件

常用属性:

1)android:checked:

2)android:text:

3)android:button:

4)android:gravity:

案例:RadioButton控件的简单使用

1.代码

1-java

2-xml

2.效果

6. CheckBox 控件

常用属性:

1)android:checked:

2)android:text:

3)android:button:

4)android:gravity:

案例:CheckBox的简单使用

1.代码

1-java

2-xml

2.效果

7.Toash类

创建方法

1)context

2)text

3)duration

附录:

素材下载


1. TextView 控件

TextView 用于显示文本信息。

常用属性:

1)android:text:

        设置要显示的文本内容

2)android:gravity:

        文本在 TextView 中的对齐方式(如居中、靠左等)。

3)android:textSize:

        文本大小,单位可以是 sp 或 dp。

4)android:textColor:

         文本颜色。

5)android:background:

设置背景颜色或图片。

6)android:padding:

        内边距。

7)android:layout_width 和 android:layout_height:

        宽度和高度设置。

8)android:maxLines:

        最大行数限制。

9)android:ellipsize:

        当文本超出 TextView 的宽度时,如何处理溢出文本(如使用省略号)。

案例:TextView的简单使用

1.代码

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"xmlns:app="http://schemas.android.com/apk/res-auto"><!--定义一个TextView--><TextViewandroid:id="@+id/textView"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Hello World!"android:textSize="40sp"android:padding="30dp"android:background="#456789"android:textColor="#892777"android:gravity="center"android:textStyle="italic"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintLeft_toLeftOf="parent"app:layout_constraintRight_toRightOf="parent"app:layout_constraintTop_toTopOf="parent"/></androidx.constraintlayout.widget.ConstraintLayout>

2.效果

2. EditText 控件

EditText 是一种可编辑的文本框,继承自 TextView

常用属性:

1)android:hint:

提示信息,当 EditText 为空时显示

2)android:inputType:

输入类型(如文本、数字、密码等)。

3)android:maxLength:

允许的最大字符数。

4)android:password:

是否显示为密码形式(星号或其他符号代替实际输入)。

5)android:lines 和 android:minLines:

显示的行数。

6)android:drawableLeft...Right...Top...Bottom:

在文本框内添加图标

案例:EditText控件的使用

1.代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><!--hint属性--><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:background="#15C1F6"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="hint属性: "tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_input"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:hint="输入控件内没有输入东西时显示"tools:ignore="MissingConstraints" /></LinearLayout><!--inputType属性--><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:background="#965DD7"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="inputType属性: "tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_input_two"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:hint="密码框"android:inputType="textPassword"tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_input_three"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:hint="电话号码"android:inputType="phone"tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_input_four"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:hint="网址"android:inputType="textUri"tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_input_five"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:hint="日期"android:inputType="date"tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_input_six"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:hint="时间"android:inputType="time"tools:ignore="MissingConstraints" /></LinearLayout><!--设置最大长度--><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:background="#EBC3D6"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="password属性: "tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_inputa"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:inputType="textPassword"android:password="true"android:hint="maxLength属性为10"android:maxLength="10"tools:ignore="MissingConstraints" /></LinearLayout><!--添加图标--><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:background="#03A06F"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="password属性: "tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_inputb"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:drawableStart="@drawable/ic_launcher_foreground"android:hint="添加图标"android:maxLength="10"tools:ignore="MissingConstraints" /></LinearLayout><!--显示行数--><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:background="#15C1F6"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="password属性: "tools:ignore="MissingConstraints" /><EditTextandroid:id="@+id/et_inputd"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="20dp"android:minLines="2"android:hint="显示行数"android:maxLength="10"tools:ignore="MissingConstraints" /></LinearLayout></LinearLayout>

2.效果

3. Button 控件

Button 用于触发事件。

常用属性:

1)android:text:

        按钮上显示的文字

2)android:onClick:

        绑定到按钮点击事件的方法名

3)android:background:

        背景样式。

4)android:enabled:

        按钮是否可用

        

5)android:visibility:

        按钮的可见性

6)android:padding:

        内边距。

7)android:drawableLeft...Right...Top...Bottom:

        在按钮旁边添加图标

案例:按钮控件的简单使用

随意找两种图片放在res == > drawable ==> 放置图片(图片命名英文开头图片命名英文开头图片命名英文开头)

1.代码

1布局文件代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:id="@+id/main"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:background="@drawable/boy"tools:context=".MainActivity"><!--按钮--><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="点击"android:id="@+id/btn"/><!--为按钮设置背景图片--><Buttonandroid:layout_width="256dp"android:layout_height="256dp"android:text="带背景图片的按钮"android:textColor="#6BF60B"android:id="@+id/btnImg"android:background="@drawable/girl"/><!--被禁用的按钮--><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="被禁用的按钮"android:enabled="false"android:background="#20DAF4"android:textColor="#5B20DB"/><!--带内边距的按钮--><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="带内边距的按钮"android:padding="20dp"android:background="#DAA4E0"android:textColor="#7140DB"android:id="@+id/btnPadding"/></LinearLayout>

 

2.java代码
package com.xiji.mycontain;import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.util.Consumer;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;public class MainActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);EdgeToEdge.enable(this);setContentView(R.layout.activity_main);ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);return insets;});//获取显示类Toast toast = Toast.makeText(this, "Hello World!", Toast.LENGTH_SHORT);/*获取控件*//*** 获取第一个控件* */View viewById = findViewById(R.id.btn);Button myButton = (Button) viewById;/*** 获取第二个控件*/@SuppressLint({"MissingInflatedId", "LocalSuppress"}) Button myImgButton = findViewById(R.id.btnImg);/*** 获取第三个控件*/@SuppressLint({"MissingInflatedId", "LocalSuppress"}) Button myTextButton = findViewById(R.id.btnPadding);//事件绑定myButton.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {//点击时触发toast.setText("普通按钮被点击了");toast.show();}});myImgButton.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {//点击时触发toast.setText("图片按钮被点击了");toast.show();}});myTextButton.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View view) {//点击时触发toast.setText("带内边距的按钮被点击了");toast.show();}});}
}

2.效果

4. ImageView 控件

ImageView 用于显示图像。

常用属性:

1)android:src:

设置要显示图像资源。

2)android:scaleType:

图像缩放类型(如 fitXYcenterCrop 等)。

3)android:adjustViewBounds:

是否根据图片调整视图边界。

4)android:contentDescription:

无障碍功能提供的描述文本。

案例:图片切换

1.代码

布局文件代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><!--使用帧布局--><FrameLayoutandroid:id="@+id/frame_layout"android:layout_width="match_parent"android:layout_height="match_parent"><ImageViewandroid:id="@+id/img_view"android:layout_width="match_parent"android:layout_height="match_parent"android:scaleType="fitXY"android:src="@drawable/girl" /><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="点击切换"android:id="@+id/btn_change"android:background="#457509"/></FrameLayout></LinearLayout>

2-java代码
package com.xiji.myimgview;import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;public class MainActivity extends AppCompatActivity {//定义点击事件按钮private Button mBtn;//图片组件获取private ImageView mImgView;//定义标志位private boolean isShow = true;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);EdgeToEdge.enable(this);setContentView(R.layout.activity_main);ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);return insets;});initView();initListener();}//控件初始化private void initView() {mImgView = findViewById(R.id.img_view);mBtn = findViewById(R.id.btn_change);}//控件事件绑定private void initListener() {mBtn.setOnClickListener(v -> {//点击事件if (isShow == true) {mImgView.setImageResource(R.drawable.boy);Toast.makeText(this, "我是小男孩", Toast.LENGTH_SHORT).show();isShow = false;return;}mImgView.setImageResource(R.drawable.girl);Toast.makeText(this, "我是小姑娘", Toast.LENGTH_SHORT).show();isShow = true;});}}

2.效果

5. RadioButton 控件

RadioButton 用于让用户从一组选项中选择一个。

常用属性:

1)android:checked:

初始选中状态。

2)android:text:

显示的文本。

3)android:button:

设置单选按钮的外观。

4)android:gravity:

文本对齐方式。

案例:RadioButton控件的简单使用

1.代码

1-java
package com.xiji.myapplication123;import android.os.Bundle;
import android.provider.MediaStore;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;public class MainActivity extends AppCompatActivity {private RadioGroup mRadioGroup;private TextView mTextView;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);EdgeToEdge.enable(this);setContentView(R.layout.activity_main);ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);return insets;});initView();initListener();}//初始化private void initView() {mRadioGroup = findViewById(R.id.radioGroup);//显示控件mTextView = findViewById(R.id.textShow);}//绑定事件private void initListener() {//radioGroup控件组mRadioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(RadioGroup group, int checkedId) {//获取选中的radioButtonRadioButton radioButton = findViewById(checkedId);//设置显示mTextView.setText(radioButton.getText());Toast.makeText(MainActivity.this,radioButton.getText(),Toast.LENGTH_SHORT).show();}});}
}

2-xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:id="@+id/main"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><LinearLayout android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"><RadioGroupandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/radioGroup"><RadioButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="男"android:id="@+id/radioBoy"android:checked="true"/><RadioButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="女"android:id="@+id/radioGril"/></RadioGroup><!--线性布局--><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"><TextViewandroid:id="@+id/textView"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="请选择性别:"/><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/textShow"android:text="男"/></LinearLayout></LinearLayout></androidx.constraintlayout.widget.ConstraintLayout>

2.效果

6. CheckBox 控件

CheckBox 用于让用户选择一个或多个选项。

常用属性:

1)android:checked:

初始选中状态。

2)android:text:

显示的文本。

3)android:button:

设置复选框的外观。

4)android:gravity:

文本对齐方式。

案例:CheckBox的简单使用

1.代码

1-java
package com.xiji.mycheckbox;import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;public class MainActivity extends AppCompatActivity {//声明变量private CheckBox checkBoxOne;private CheckBox checkBoxTwo;private CheckBox checkBoxThree;//展示private TextView textView;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);EdgeToEdge.enable(this);setContentView(R.layout.activity_main);ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);return insets;});initView();initEvent();}//控件初始化private void initView() {checkBoxOne = findViewById(R.id.myCheckOne);checkBoxTwo = findViewById(R.id.myCheckTwo);checkBoxThree = findViewById(R.id.myCheckThree);textView = findViewById(R.id.myLikeShow);}//事件private void initEvent() {checkBoxOne.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(CompoundButton compoundButton, boolean b) {String text = (String) checkBoxOne.getText();if (b) {textView.setText(textView.getText()+text);return;}//如果没有选中那么就把文字去掉textView.setText(textView.getText().toString().replace(text,""));}});checkBoxTwo.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(CompoundButton compoundButton, boolean b) {String text = (String) checkBoxTwo.getText();if (b) {textView.setText(textView.getText()+text);return;}//如果没有选中那么就把文字去掉textView.setText(textView.getText().toString().replace(text,""));}});checkBoxThree.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(CompoundButton compoundButton, boolean b) {String text = (String) checkBoxThree.getText();if (b) {textView.setText(textView.getText()+text);return;}//如果没有选中那么就把文字去掉textView.setText(textView.getText().toString().replace(text,""));}});}}

2-xml
    <?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:id="@+id/main"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"tools:ignore="MissingConstraints"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="请选择你喜欢的游戏"/><CheckBoxandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="流放之路"android:checked="true"android:id="@+id/myCheckOne"/><CheckBoxandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="英雄联盟"android:id="@+id/myCheckTwo"/><CheckBoxandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="星际战甲"android:id="@+id/myCheckThree"/><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="喜欢的游戏: "android:id="@+id/myLikeShow"/></LinearLayout></androidx.constraintlayout.widget.ConstraintLayout>

2.效果

7.Toash类

Toast 用于显示简短的消息提示。

创建方法

Toast.makeText(Context context, CharSequence text, int duration).show();

1)context

        上下文环境。

2)text

        显示的消息文本。

3)duration

        显示时间长度,通常使用 Toast.LENGTH_SHORT 或 Toast.LENGTH_LONG

附录:

素材下载

girl.png等2个文件官方版下载丨最新版下载丨绿色版下载丨APP下载-123云盘

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

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

相关文章

嵌入式C语言中链表的插入实现方法

大家好,今天主要给大家分享一下,如何使用链表插入功能。 第一:嵌入式中链表具体实现 链表查找思路:从链表的a0起,判断是否为第i结点,若是则返回该结点的指针,否则查找下一结点,依次类推。 具体代码的链表插入实现: linklist Locate(linklist_t h, data_t x) { …

MySQL 分组

MySQL 分组 在数据库管理中&#xff0c;分组是一种强大的功能&#xff0c;它允许用户根据一个或多个列对数据进行分类&#xff0c;并对每个组执行聚合操作。MySQL 作为最流行的关系型数据库管理系统之一&#xff0c;提供了丰富的分组功能。本文将详细介绍 MySQL 中的分组概念、…

Android车载——VehicleHal运行流程(Android 11)

1 概述 本篇主要讲解VehicleHal的主要运行流程&#xff0c;包括设置属性、获取属性、订阅属性、取消订阅、持续上报属性订阅等。 2 获取属性流程 2.1 获取属性流程源码分析 作为服务注册到hwServiceManager中的类是VehicleHalManager&#xff0c;所以&#xff0c;CarServic…

WOFOST模型与PCSE模型

农作物生长模型概述 1、介绍农作物生长模型的用途和应用领域 2、比较WOFOST模型和PCSE模型的特点和优势 数据准备 1、气象数据&#xff1a; 数据类型&#xff1a;温度、降水、湿度、风速等气象要素数据。 数据格式&#xff1a;时间序列数据&#xff0c;通常以日为单位。 …

EXCELWPS工作表批量重命名(按照sheet1中A列内容)

将工作表名称批量重命名&#xff08;按照sheet1中A列内容&#xff09; 打开WPS Office的Excel文件。按 Alt F11 打开VBA编辑器。在VBA编辑器中&#xff0c;插入一个新模块&#xff1a;点击 插入 -> 模块。将以下代码粘贴到模块中&#xff1a;运行→运行宏 Sub RenameShee…

使用 Vertex AI Gemini 模型和 Elasticsearch Playground 快速创建 RAG 应用程序

作者&#xff1a;来自 Elastic Jeff Vestal 在这篇博客中&#xff0c;我们将使用 Elastic 的 Playground 和 Vertex AI API 将 Elasticsearch 连接到 Google 的 Gemini 1.5 聊天模型。将 Gemini 模型添加到 Playground 使 Google Cloud 开发人员能够快速建立 LLM、测试检索、调…

宠物空气净化器怎么选?希喂、霍尼韦尔、美的宠物哪款除毛好?

身为养宠五年的资深铲屎官&#xff0c;最近收到了很多新手养宠朋友关于宠物空气净化器的挑选疑问。宠物空气净化器作为宠物领域目前最火热的产品&#xff0c;谈论度一直很高&#xff0c;评价也褒贬不一。双十一购物节又即将到来&#xff0c;大家都想赶上这一波优惠活动。 铺天盖…

低代码工单管理app评测,功能与效率解析

预计到2030年&#xff0c;低代码平台市场将达1870亿美元。ZohoCreator助力企业构建定制化软件应用&#xff0c;以建筑行业工作订单管理app为例&#xff0c;简化流程&#xff0c;提升管理效率&#xff0c;降低成本。其用户友好界面、自动化管理、跨平台使用及全面报告功能受企业…

基于差分进化灰狼混合优化的SVM(DE-GWO-SVM)数据预测算法matlab仿真

目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.本算法原理 4.1 DE优化 4.2 GWO优化 5.完整程序 1.程序功能描述 基于差分进化灰狼混合优化的SVM(DE-GWO-SVM)数据预测算法matlab仿真&#xff0c;对比SVM和GWO-SVM。 2.测试软件版本以及运行结果展示…

实施威胁暴露管理、降低网络风险暴露的最佳实践

随着传统漏洞管理的发展&#xff0c;TEM 解决了因攻击面扩大和安全工具分散而产生的巨大风险。 主动式 TEM 方法优先考虑风险并与现有安全工具无缝集成&#xff0c;使组织能够在威胁被有效利用之前缓解威胁。 为什么威胁暴露管理 (TEM) 在现代网络安全策略中变得至关重要&…

获取时隔半个钟的三天

摘要&#xff1a; 今天遇到需求是配送时间&#xff0c;时隔半个钟的排线&#xff01;所以需要拼接时间&#xff01;例如2024-10-08 14&#xff1a;30&#xff0c;2024-10-08 15&#xff1a;00&#xff0c;2024-10-08 15&#xff1a;30 <el-form-item label"配送时间&a…

如何使用bpmn-js实现可视化流程管理

介绍 BPMN-JS是一个流行的开源库&#xff0c;用于在Web应用程序中可视化、创建、编辑和分析BPMN&#xff08;Business Process Model and Notation&#xff0c;业务流程建模与表示法&#xff09;2.0 图。BPMN是一种国际标准的图形化语言&#xff0c;用于描述企业中的业务流程&a…

【数据结构】string(C++模拟实现)

string构造 string::string(const char* str):_size(strlen(str)) {_str new char[_size 1];_capacity _size;strcpy(_str, str); }// s2(s1) string::string(const string& s) {_str new char[s._capacity 1];strcpy(_str, s._str);_size s._size;_capacity s._cap…

BlackMarket_ 1靶机渗透

项目地址 plain https://download.vulnhub.com/blackmarket/BlackMarket.zip 实验过程 开启靶机虚拟机 ![](https://img-blog.csdnimg.cn/img_convert/169d964d61ea9660c1104e723f71449e.png) 使用nmap进行主机发现&#xff0c;获取靶机IP地址 plain nmap 192.168.47.1-254…

图论day57|建造最大岛屿(卡码网)【截至目前,图论的最高难度】

图论day57|建造最大岛屿&#xff08;卡码网&#xff09;【截至目前所做的题中&#xff0c;图论的最高难度】 思维导图分析 104.建造最大岛屿&#xff08;卡码网&#xff09;【截至目前所做的题中&#xff0c;图论的最高难度】 思维导图分析 104.建造最大岛屿&#xff08;卡码网…

git在已有的项目基础上获取远程仓库指定分支操作方法

要在本地项目中拉取远程仓库的特定分支&#xff0c;你可以使用以下步骤&#xff1a; 确保你已经有了一个本地的 Git 项目。运行 git fetch 命令来获取远程仓库的所有更新。使用 git checkout 命令切换到你想要的远程分支。 # 1. 获取远程仓库的所有更新 git fetch origin# 2.…

uniapp 小程序,登录上传头像昵称页面处理步骤

登录上传头像 成功前阻塞 处理成功后才跳转回 游戏页面 为了能看见最新上传的头像显示&#xff0c;处理方式是 重新封装base64处理方法为promise 这样可以用await等待&#xff0c;请求后台的方法也等待&#xff0c;等待处理完成后调用跳转页面方法&#xff0c;同时信息上传完成…

带你解锁Open_FLUX.1模型的神奇世界!

大家好我是极客菌&#xff01;&#xff01;&#xff01; Open_FLUX.1模型&#xff0c;作为ComfyUI的最新力作&#xff0c;已经在AI绘画领域引起了广泛的关注。这款模型以其独特的艺术风格和强大的创作能力&#xff0c;为艺术家们提供了一个全新的创作平台。今天&#xff0c;就…

OJ在线评测系统 微服务高级 Gateway网关接口路由和聚合文档 引入knife4j库集中查看管理并且调试网关项目

Gateway微服务网关接口路由 各个服务之间已经能相互调用了 为什么需要网关 因为我们的不同服务是放在不同的端口上面的 如果前端调用服务 需要不同的端口 8101 8102 8103 8104 我们最好提供一个唯一的 给前端去调用的路径 我们学习技术的时候必须要去思考 1.为什么要用&am…

面试指南1009

redis中存储对象使用哪种数据结构&#xff1f;Mybatis中如何实现级联查询的&#xff0c;比如说emp表和dept表Spring中的两大核心是什么&#xff1f;你是如何处理数据库表字段与数据库字段不一致的&#xff1f;Myabtis中一级缓存与二级缓存有了解吗&#xff1f;AOP中有哪些属性&…