Android——监听事件总结

各种监听事件

1.按钮 Button
(1)点击监听
btn_1.setOnClickListener(new View.OnClickListener() {

(2)长按监听
btn_1.setOnLongClickListener(new View.OnLongClickListener() {

2.单选框 RadioGroup
radio_gp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

3.复选框 CheckBox(普通内部类)
cb_fuxuan1.setOnCheckedChangeListener(new checkboxcheckedlistener());
cb_fuxuan2.setOnCheckedChangeListener(new checkboxcheckedlistener());

private class checkboxcheckedlistener implements CompoundButton.OnCheckedChangeListener
{}

4.上下文菜单 ContextMenu(需要长按才能触发)

changan_menu.setOnCreateContextMenuListener(this);
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
//获取值
public boolean onContextItemSelected(MenuItem item) {
item.getItemId()}

5.进度条 SeekBar(可拖动)

sbr_td.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {}

6.开关 开关按钮:ToggleButton 推拉开关 Switch

tb.setOnCheckedChangeListener(new anniucheckedlistener());
private class anniucheckedlistener implements CompoundButton.OnCheckedChangeListener{

 7.对话框 方法链构造 new AlertDialog.Builder(this)

 单选对话框

final String[] yanse = {"红","黄","绿","蓝","白"};

 .setSingleChoiceItems(yanse, 0, new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) { 

//多选对话框
final String[] yanse = {"红","黄","绿","蓝","白"};
final boolean[] bl = {true,true,false,false,false}; 

.setMultiChoiceItems(yanse, bl, new DialogInterface.OnMultiChoiceClickListener() {

public void onClick(DialogInterface dialog, int which, boolean isChecked) {

 //自定义对话框 加载器

getLayoutInflater() setview 

LayoutInflater layoutInflater = getLayoutInflater();

 }

}

8.进度条 ProgressDialog

 //旋转进度条

final ProgressDialog pd = new ProgressDialog(this);

 //水平进度条

ProgressDialog pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);

 9.日期对话框

Calendar cl = Calendar.getInstance();

 DatePickerDialog datePickerDialog = new DatePickerDialog(this,监听, cl.get(Calendar.YEAR),cl.get(Calendar.MONTH),cl.get(Calendar.DAY_OF_MONTH));

 datePickerDialog.show();

 //监听 =

new DatePickerDialog.OnDateSetListener() {

@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
}
}
10.时间对话框
//获取当前日期
//单例模式,设计模式的一种 静态方法
Calendar cl = Calendar.getInstance();

 TimePickerDialog timePickerDialog = new TimePickerDialog(this,监听,cl.get(Calendar.HOUR),cl.get(Calendar.MINUTE),true);

 timePickerDialog.show();

//监听 =

new TimePickerDialog.OnTimeSetListener() {

@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {

 }

}
11.ListView

 (1)ArrayAdapter

 //构造适配器

ArrayAdapter adapter = new ArrayAdapter(this,R.layout.listview_layout,list);

 //设置适配器

listview_1.setAdapter(adapter);

 //监听事件

listview_1.setOnItemClickListener(new AdapterView.OnItemClickListener() {

 @Override

public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

 (2)SimpleAdapter

 SimpleAdapter simpleAdapter = new SimpleAdapter(this,im,R.layout.simple_layout,str,viewid);

 simple_1.setAdapter(simpleAdapter);

 simple_1.setOnItemClickListener();

(3)BaseAdapter

 12.自动提示文本框

AutoCompleteTextView autv_1 = (AutoCompleteTextView)findViewById(R.id.atv_1);

 13下拉列表

Spinner sper_1 = (Spinner)findViewById(R.id.sper_1);

 sper_1.setAdapter(adapter);

 sper_1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

 14.消息提示

Resources res = Activitywenben.this.getResources();
//1.获取状态栏消息管理器
NotificationManager manager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
//2.构建消息 用Builder构建 方法链调用
Notification nt = new Notification.Builder(this)
//3.交给管理器发出消息
manager.notify(0,nt);

  xml

 

复制代码
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:id="@+id/textview1"android:text="有链接吗?"android:autoLink="all"/><AutoCompleteTextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:id="@+id/autv_1"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="按钮的监听"android:id="@+id/btn_1"android:background="@drawable/anniu1"/><RadioGroupandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"android:id="@+id/radio_gp"><RadioButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="是"android:id="@+id/rb_shi"/><RadioButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="否"android:id="@+id/rb_fou"/></RadioGroup><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="hello world"android:id="@+id/et_1"/><CheckBoxandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="复选一"android:id="@+id/cb_fuxuan1"/><CheckBoxandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="复选二"android:id="@+id/cb_fuxuan2"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="长按触发上下文菜单"android:id="@+id/menu_1"/><SeekBarandroid:layout_width="match_parent"android:layout_height="wrap_content"android:max="100"android:id="@+id/sbr_tuodong"/><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:background="@drawable/anniu2"android:id="@+id/iv_bian"/><ToggleButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textOn="开"android:textOff="关"android:id="@+id/tgb_1"/><Switchandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/swh_1"/><!--对话框--><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发普通对话框"android:onClick="putongdhkonclick"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发单选对话框"android:onClick="danxuandhkonclick"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发多选对话框"android:onClick="duoxuandhkonclick"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发自定义对话框"android:onClick="zidingyidhkonclick"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发旋转进度条"android:onClick="xuanzhuanjdtonclick"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发水平进度条"android:onClick="shuipingjdtonclick"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发日期对话框"android:onClick="riqidhkonclick"/><Buttonandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="点击触发时间对话框"android:onClick="shijiandhkonclick"/></LinearLayout></ScrollView>
复制代码

 

java

复制代码
package com.example.chenshuai.test322;import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.app.ProgressDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.util.Linkify;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import android.widget.ToggleButton;import java.util.Calendar;/*** Created by chenshuai on 2016/4/1.*/
public class Jianting extends AppCompatActivity {ImageView iv_bian;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.jiantinglayout);//TextviewTextView textview1 = (TextView)findViewById(R.id.textview1);textview1.setAutoLinkMask(Linkify.ALL);String linktext = "百度链接 www.baidu.com";textview1.setText(linktext);//AutoCompleteTextViewAutoCompleteTextView autv_1 = (AutoCompleteTextView)findViewById(R.id.autv_1);String[] str = {"ab","abc","abcd"};ArrayAdapter<String> stringArrayAdapter= new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,str);autv_1.setAdapter(stringArrayAdapter);//Button 点击Button btn_1 = (Button)findViewById(R.id.btn_1);btn_1.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Toast.makeText(Jianting.this, "按钮点击监听", Toast.LENGTH_SHORT).show();}});//Button 长按监听btn_1.setOnLongClickListener(new View.OnLongClickListener() {@Overridepublic boolean onLongClick(View v) {Toast.makeText(Jianting.this, "按钮长按监听", Toast.LENGTH_SHORT).show();return false;}});//RadioGroup 的监听RadioGroup radio_gp = (RadioGroup)findViewById(R.id.radio_gp);radio_gp.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(RadioGroup group, int checkedId) {RadioButton rb_shi = (RadioButton) findViewById(R.id.rb_shi);RadioButton rb_fou = (RadioButton) findViewById(R.id.rb_fou);switch (checkedId) {case R.id.rb_shi:Toast.makeText(Jianting.this, "选中了" + rb_shi.getText(), Toast.LENGTH_SHORT).show();case R.id.rb_fou:Toast.makeText(Jianting.this, "选中了" + rb_fou.getText(), Toast.LENGTH_SHORT).show();}}});//显示Edittext的输入内容EditText editText = (EditText)findViewById(R.id.et_1);String str1 = editText.getText().toString();Toast.makeText(Jianting.this, str1, Toast.LENGTH_SHORT).show();//checkbox的监听CheckBox cb_fuxuan1 = (CheckBox)findViewById(R.id.cb_fuxuan1);cb_fuxuan1.setOnCheckedChangeListener(new checkboxcheckedlistener());CheckBox cb_fuxuan2 = (CheckBox)findViewById(R.id.cb_fuxuan2);cb_fuxuan2.setOnCheckedChangeListener(new checkboxcheckedlistener());//menu 菜单 上下文菜单Button changan_menu = (Button)findViewById(R.id.menu_1);changan_menu.setOnCreateContextMenuListener(this);//SeekBar 可拖动进度条SeekBar sbr_td = (SeekBar)findViewById(R.id.sbr_tuodong);sbr_td.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {@Overridepublic void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {}@Overridepublic void onStartTrackingTouch(SeekBar seekBar) {}@Overridepublic void onStopTrackingTouch(SeekBar seekBar) {}});//开关键控制按钮背景iv_bian = (ImageView)findViewById(R.id.iv_bian);//开关按钮ToggleButton tb = (ToggleButton)findViewById(R.id.tgb_1);tb.setOnCheckedChangeListener(new anniucheckedlistener());//推拉开关Switch swh = (Switch)findViewById(R.id.swh_1);swh.setOnCheckedChangeListener(new anniucheckedlistener());}//普通内部类  checkbox的监听private class checkboxcheckedlistener implements CompoundButton.OnCheckedChangeListener{@Overridepublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {CheckBox cb = (CheckBox)buttonView;if (isChecked){Toast.makeText(Jianting.this, "选中了"+cb.getText(), Toast.LENGTH_SHORT).show();}else{Toast.makeText(Jianting.this, "取消选中了"+cb.getText(), Toast.LENGTH_SHORT).show();}}}//menu 菜单 上下文菜单@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {menu.add(1,1,1,"添加");menu.add(1,2,2,"删除");menu.add(1,3,3,"修改");super.onCreateContextMenu(menu, v, menuInfo);}@Overridepublic boolean onContextItemSelected(MenuItem item) {switch (item.getItemId()){case 1:Toast.makeText(Jianting.this, "触发了添加功能", Toast.LENGTH_SHORT).show();case 2:Toast.makeText(Jianting.this, "触发了删除功能", Toast.LENGTH_SHORT).show();case 3:Toast.makeText(Jianting.this, "触发了修改功能", Toast.LENGTH_SHORT).show();}return super.onContextItemSelected(item);}private class anniucheckedlistener implements CompoundButton.OnCheckedChangeListener{@Overridepublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {if (isChecked){iv_bian.setImageResource(R.drawable.anniu1);}else{iv_bian.setImageResource(R.drawable.anniu2);}}}//普通对话框public void putongdhkonclick(View view){//普通对话框//对话框的构建器/* AlertDialog.Builder ab = new AlertDialog.Builder(this);ab.setTitle("数据删除");ab.setMessage("确定删除吗?");ab.setPositiveButton("确定",null);ab.setNegativeButton("取消",null);ab.setCancelable(false);ab.show();*///方法链的方法new AlertDialog.Builder(this).setTitle("数据删除").setMessage("确定删除吗?").setPositiveButton("确定",null).setNegativeButton("取消",null).setCancelable(false).show();}public void danxuandhkonclick(View view){final String[] yanse = {"红","黄","绿","蓝","白"};//方法链new AlertDialog.Builder(this).setTitle("单选对话框").setSingleChoiceItems(yanse, 0, new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {Toast.makeText(Jianting.this, "选中了" + yanse[which], Toast.LENGTH_SHORT).show();//移除属性 dialog.dismiss(); 选中一个就会关闭}}).setNeutralButton("确定", null)//普通按钮.setCancelable(false).show();}public void duoxuandhkonclick(View view){final String[] yanse = {"红","黄","绿","蓝","白"};final boolean[] bl = {true,true,false,false,false};//方法链new AlertDialog.Builder(this).setTitle("多选对话框").setMultiChoiceItems(yanse, bl, new DialogInterface.OnMultiChoiceClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which, boolean isChecked) {if (isChecked) {Toast.makeText(Jianting.this, "选中了" + yanse[which], Toast.LENGTH_SHORT).show();} else {Toast.makeText(Jianting.this, "取消选中了" + yanse[which], Toast.LENGTH_SHORT).show();}}}).setNeutralButton("确定", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {//遍历数组 foreach循环for (boolean b : bl) {try {Thread.sleep(100);} catch (Exception ex) {}Toast.makeText(Jianting.this, "取值"+b, Toast.LENGTH_SHORT).show();}}}).setCancelable(false).show();}//自定义对话框public void zidingyidhkonclick(View view){//1.获取加载器LayoutInflater layoutInflater = getLayoutInflater();//2.用加载器加载文件final View view2 = layoutInflater.inflate(R.layout.loginlayout, null);//方法链构造页面加两个按钮new AlertDialog.Builder(this).setView(view2)//兼容性好,比较适用//.setView(R.layout.loginlayout).setNegativeButton("取消", null).setPositiveButton("登陆", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {EditText user = (EditText) view2.findViewById(R.id.et_username);EditText pas = (EditText) view2.findViewById(R.id.et_password);}}).show();}//旋转进度条public void xuanzhuanjdtonclick(View view){final ProgressDialog pd = new ProgressDialog(this);pd.setMessage("正在加载");pd.show();//创建thread实例  =【重写run方法  启动多线程new Thread(){@Overridepublic void run() {super.run();try{Thread.sleep(3000);}catch (Exception ex){}pd.dismiss();//关闭}}.start();}//水平进度条public void shuipingjdtonclick(View view){ProgressDialog pd = new ProgressDialog(this);pd.setMessage("正在加载");pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);pd.show();}//日期对话框public void riqidhkonclick(View view){//获取当前日期//单例模式,设计模式的一种  静态方法Calendar cl = Calendar.getInstance();DatePickerDialog datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {@Overridepublic void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {Toast.makeText(Jianting.this, year+"-"+ (monthOfYear+1) + "-" + dayOfMonth, Toast.LENGTH_SHORT).show();}},cl.get(Calendar.YEAR),cl.get(Calendar.MONTH),cl.get(Calendar.DAY_OF_MONTH));datePickerDialog.setCancelable(false);datePickerDialog.show();}//时间对话框public void shijiandhkonclick(View view){//获取当前日期//单例模式,设计模式的一种  静态方法Calendar cl = Calendar.getInstance();TimePickerDialog timePickerDialog = new TimePickerDialog(this, new TimePickerDialog.OnTimeSetListener() {@Overridepublic void onTimeSet(TimePicker view, int hourOfDay, int minute) {Toast.makeText(Jianting.this, hourOfDay+":"+minute , Toast.LENGTH_SHORT).show();}},cl.get(Calendar.HOUR),cl.get(Calendar.MINUTE),true);timePickerDialog.setCancelable(false);timePickerDialog.show();}
}
复制代码

转载于:https://www.cnblogs.com/DreamRecorder/p/8961966.html

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

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

相关文章

ChatGPT 大智近妖,从宇宙人生到手搓光刻机,从哄女朋友到写年终总结我们聊得非常开心,反而让人越来越忧心...

都说 ChatGPT 要干掉程序员&#xff0c;清理搜索引擎&#xff0c;取代Stack Overflow&#xff0c;还能消灭人类&#xff0c;这些有些言过其实了。ChatGPT 的定位是一个人工智能助理&#xff0c;它说&#xff0c;它的主要目的是通过回答用户的问题&#xff0c;为用户提供帮助。在…

如何在Windows Defender中安排扫描

Windows Defender automatically performs background scans during your PC’s idle moments, but doesn’t include an easy way to schedule a full scan. There is a way to do it, though. Windows Defender在PC空闲时自动执行后台扫描&#xff0c;但是没有包括安排完整扫…

复习深入笔记02:魔法方法/cookie,session,token/异常

魔法方法 对象生成 1.先调用__new__方法&#xff0c;生成空对象。控制对象生成。 2.当执行“对象类名&#xff08;namelqz&#xff09;”&#xff0c;触发类的__init__()

比特熊故事汇独家 | .NET 感恩专场

点击上方蓝字关注我们&#xff08;本文阅读时间&#xff1a;15分钟)大家好&#xff01;我是爱吃、爱玩、更爱学习技术&#xff0c;IT界新晋小红人&#xff0c;开发者的好朋友——比特熊&#xff01;比特熊&#xff1a;本期故事汇是.NET专场&#xff0c;今天一次性邀请到DOTNET领…

Ubuntu Core 给物联网提供更多安全支持

开发四年只会写业务代码&#xff0c;分布式高并发都不会还做程序员&#xff1f; Canonical 是 Ubuntu 的一个桌面环境&#xff0c;该公司目前在云服务业务赚到了钱。因为 Ubuntu Core 为嵌入式设备带来了 Ubuntu 18.04 长期支持(LTS)代码库。Ubuntu Core 的镜像大小为 260MB&…

semantic ui要装什么才能使用

作者&#xff1a;呆呆笨笨链接&#xff1a;https://www.zhihu.com/question/32233356/answer/196799506来源&#xff1a;知乎著作权归作者所有。商业转载请联系作者获得授权&#xff0c;非商业转载请注明出处。本答案将以两种方式讲解如何从零开始使用 Semantic-UI&#xff0c;…

用户帐户控制设置_创建快捷方式以避免用户帐户控制弹出式快捷方式

用户帐户控制设置There are numerous applications which, when launched, result in a UAC (User Account Control) warning being displayed. There are reasons why this security measure is a good idea, but it can also be extremely irritating. ElevatedShortcut lets…

rest_framework01:前后端分离\规范\简单例子(查询某本书)

web 开发模式 RESTful规范 1 数据的安全保障 url链接一般都采用https协议进行传输 注&#xff1a;采用https协议&#xff0c;可以提高数据交互过程中的安全性 2 接口特征表现 用api关键字标识接口url&#xff1a; https://api.baidu.comhttps://www.baidu.com/api注&#xff…

.NET Core如何通过SSL访问MongoDB?

【.NET Core】| 总结/Edison Zhou大家好&#xff0c;我是Edison。最近有一个ASP.NET Core通过SSL证书访问MongoDB的需求&#xff0c;但是在网上发现资料很少&#xff0c;于是调查了一番&#xff0c;做了如下的笔记&#xff0c;希望对你有用。背景在实际场景中&#xff0c;开发环…

在pom.xml中配置nexus上传地址

2019独角兽企业重金招聘Python工程师标准>>> <distributionManagement> <repository> <id>thirdparty</id> <url>http://&#xff5b;nexusIP地址&#xff5d;:8081/nexus/content/repositories/thi…

网页背景平铺_在大约十秒钟内为网页创建无缝平铺背景

网页背景平铺Creating a background image for your webpage (or desktop background) isn’t challenging at all. In fact, even a newbie Photoshop user can bash one out in about ten seconds. Here’s the simplest of simple methods with surprising, great results. …

9月11日学习内容整理:正则表达式,re模块

一、正则表达式&#xff1a;正则是很大的一个知识点&#xff0c;不会仅仅是下面这些东西 1、概念&#xff1a;正则表达式就是一种对字符串匹配的规则&#xff0c;注意是只对字符串&#xff0c;正则表达式和python没啥关系&#xff0c; 2、表达式&#xff1a; &#xff08;1&…

MongoDB的安装与使用

MongoDB是一款NoSql数据库。NoSql数据库叫非关系型数据库&#xff0c;NoSql的全名Not only sql。是为了解决高并发、高可用、高可扩展&#xff0c;以及大数据存储等一系列问题而产生的数据库解决方案。NoSql&#xff0c;它不能替代关系型数据库&#xff0c;只能作为关系型数据库…

linux 基准测试_如何对Linux系统进行基准测试:3个开源基准测试工具

linux 基准测试Linux’s command-line utilities can do anything, including perform benchmarks – but using a dedicated benchmarking program is a simpler and more foolproof process. These utilities allow you to perform reproducible tests across different syst…

.NET 7 新增的 IParsable 接口介绍

.NET 7 是一个新版本的 .NET&#xff0c;它新增了一个名为 IParsable 的接口。这个接口可以帮助开发人员更容易地在代码中解析字符串。IParsable 接口包含两个方法&#xff1a;Parse 和 TryParse。Parse 方法用于将一个字符串解析为指定类型的值。如果解析失败&#xff0c;则会…

spring+springMvc+struts的SSH框架整合

1.建立一个web项目 2.导入SSH框架所需jar包 3.配置web.xml文件 <?xml version"1.0" encoding"UTF-8"?> <web-app xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance" xmlns"http://java.sun.com/xml/ns/javaee" xsi:sc…

听说这个语言认知服务又出新功能了?

点击上方蓝字关注我们&#xff08;本文阅读时间&#xff1a;7分钟)语言是人类智能发展的基石。鉴于语言拥有普遍性&#xff0c;几乎没有特定的技术或 AI 技术得以颠覆整个社会。微软的使命是赋能地球上的每个人和每个组织&#xff0c;帮助他们取得更多成就。立足于该使命&#…

自定义异常最佳实践_播放,自定义和组织媒体的最佳文章

自定义异常最佳实践Computers today are used for much more than generating documents, writing and receiving email, and surfing the web. We also use them to listen to music, watch movies and TV shows, and to transfer media to and from mobile devices. 如今&…

CSS中的路径裁剪样式clip-path

前面的话 CSS借鉴了SVG裁剪的概念&#xff0c;设置了clip-path样式&#xff0c;本文将详细介绍路径裁剪clip-path 概述 clip-path属性可以防止部分元素通过定义的剪切区域来显示&#xff0c;仅通过显示的特殊区域。剪切区域是被URL定义的路径代替行内或者外部svg&#xff0c;或…

macos mojave_如何修复macOS Mojave上的模糊字体(使用亚像素抗锯齿)

macos mojaveApple’s macOS Mojave disables subpixel antialiasing, also known as font smoothing, by default. On a MacBook Air or a desktop Mac hooked up to a non-Retina display, upgrading will make your fonts look worse. 苹果的macOS Mojave默认情况下禁用子像…