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.pswp.cn/news/280469.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/280469.shtml
英文地址,請注明出處:http://en.pswp.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…

Java Observer Pattern(觀察者模式)

當對象間存在一對多關系時&#xff0c;則使用觀察者模式&#xff08;Observer Pattern&#xff09;。比如&#xff0c;當一個對象被修改時&#xff0c;則會自動通知它的依賴對象。觀察者模式屬于行為型模式。 關鍵代碼&#xff1a;在抽象類里有一個 ArrayList 存放觀察者們。 優…

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;開發環…

SQA

一、長大一條龍SQA計劃 SQA計劃需要包含軟件工程質量保證、質量控制、數據收集和統計報告這四方面內容&#xff0c;計劃以時間為線索&#xff0c;小組內成員為對象&#xff0c;以下為我組的工作計劃&#xff1a; 時間 任務 需完成的情況 2017年10月 用戶登錄注冊后臺實現 …

在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&…

rest_framework02:修改數據/校驗鉤子/read_only和write_only

修改數據 1.傳入數據&#xff0c;選中data&#xff0c;以及修改data book_ser BookSerializer(instancebook, datarequest.data) 2.校驗&#xff0c;通過則保存。 if book_ser.is_valid(): # 返回True 表示驗證通過book_ser.save() # 不是book.save() rest_framework…

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;則會…

CentOS 7安裝nginx+php+mysql環境

0x01 安裝php 1、首先得安裝第三方軟件庫 yum install epel-release 復制代碼2、安裝依賴包 yum install gcc gcc-c glibc libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-de…

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…