Android中tools屬性的使用

參考:
1.Android:Tools命名空間原來是有大用處的
2.Android中tools屬性的使用
3.工具屬性參考文檔
4. 命名空間介紹
5. 注解
6. lint
7. 資源壓縮shrink-resources

目錄

  • 一、概述
  • 二、引入tools命名空間
  • 三、tools 命名空間的作用有哪些?
  • 四、tools 命名空間屬性功能詳解
    • (一)、xml 中的錯誤處理屬性
      • 1、tools:ignore
      • 2、tools:targetApi
      • 3、 tools:locale
    • (二)、xml視圖預覽相關屬性
      • 1、用 tools:xxxx 替代 android:xxxx
      • 2、tools:context
      • 3、tools:itemCount
      • 4、tools:layout
      • 5、tools:listitem 、 tools:listheader 、 tools:listfooter
      • 6、 tools:showIn
      • 7、 tools:menu
      • 8、 tools:minValue / tools:maxValue
      • 9、 tools:openDrawer
      • 10、 "@tools:sample/*" 資源
    • (三)、資源壓縮相關屬性 ([Resource shrinking](https://developer.android.google.cn/studio/build/shrink-code?hl=zh-cn#shrink-resources) attributes)
      • 1、 tools:shrinkMode
      • 2、 tools:keep
      • 3、 tools:discard

一、概述

??Android Studio在tools命名空間中支持一些XML屬性來開關設計功能和編譯時行為。當構建應用時,構建工具會刪除這些屬性,從而不會影響APK的大小和運行行為。

二、引入tools命名空間

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools" >

三、tools 命名空間的作用有哪些?

根據官方文檔描述,根據其屬性的功能類別,大致有三種主要功能:

  • xml中的錯誤處理
  • xml 預覽
  • 資源壓縮

說的通俗一點就是:

  • 減少或者避免黃線提示,讓代碼更清爽,讓編譯少報錯
  • 讓預覽界面更靈活,可以隨心所欲的定制預覽視圖
  • 壓縮資源文件,降低APK體積。

四、tools 命名空間屬性功能詳解

(一)、xml 中的錯誤處理屬性

1、tools:ignore

說明
應用范圍xml中的任意元素
作用對象Lint (Lint 是AndroidStudio提供的代碼掃描工具)
具體作用讓Lint 工具在檢查代碼時忽略指定的錯誤。
取值說明不同的錯誤對應不同的id,這些id 就是 ignore的取值。如:MissingTranslation。ignore后面可以同時跟多個id,多個id之間使用逗號分割

示例1:
??Lint 檢查時默認語言為 英文,如果在 xml 中有中文,就會報 MissingTranslation 錯誤,我們加上 tools:ignore 之后即可避免。

<string name="show_all_apps" tools:ignore="MissingTranslation">All</string>

示例2:
在這里插入圖片描述

2、tools:targetApi

說明
應用范圍xml的任意元素
作用對象Lint
具體作用同 java 代碼中的 @TargetApi 注解, 指明某個控件只在指定的API 及更高的版本中生效。這樣,在使用 Lint 檢測時就不會因 minSdkVersion 低于控件出現的版本而報錯。
取值說明 API 版本號對應的 int值

示例:

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"tools:targetApi="14" >

3、 tools:locale

說明
應用范圍<resources>
作用對象Lint, Android Studio editor
具體作用指明 resources 中元素的語言類型,避免拼寫檢查或者Lint 檢查時報錯。這兩者中默認的語言類型時英文 es
取值說明

示例:
??我們在 values/strings.xml中指明元素的語言版本。

<resources xmlns:tools="http://schemas.android.com/tools"    tools:locale="es">

(二)、xml視圖預覽相關屬性

以下屬性在xml中定義之后,只在預覽時會展示,正式部署之后并不會展示。類似于 DataBindg 中引用字符串資源時的 default 屬性。

1、用 tools:xxxx 替代 android:xxxx

說明
應用范圍view
作用對象Android Studio布局編輯器
具體作用將view的任意屬性值的 android 前綴替換為 tools 之后,就可以實現預覽效果。以tools 為命名空間的屬性值只在預覽時有效。 另外,在預覽時,如果同時有 tools:xxx 和 android:xxx ,則優先展示 tools:xxx 的預覽效果, 可參考示例代碼2
取值說明具體取值以view的屬性取值為準

示例代碼1:
??預覽時展示指定文本

<TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"tools:text="歡迎關注 CnPeng 公眾號"/>

示例代碼2:
??tools:text 和 android:text 同時存在,在預覽時會優先展示 tools:text

<TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"tools:text="這些在預覽時展示,并會在預覽時優先于 android:text 展示"android:text="這些在部署之后會展示"/>

2、tools:context

說明
應用范圍xml 中的根布局
作用對象Lint, Android Studio布局編輯器
具體作用**聲明該布局文件默認關聯的 activity。**聲明之后會在布局編輯器或者預覽界面中開啟一些與該activity相關的特性,比如,在寫 onClick時,直接輸入方法名,然后點擊自動完成代碼的快捷鍵就會提示你在對應activity中創建該方法。This enables features in the editor or layout preview that require knowledge of the activity, such as what the layout theme should be in the preview and where to insertonClickhandlers when you make those from a quickfix .
取值說明關聯的activity。需要帶路徑,建議與清單文件中注冊 activity時的路徑保持一致。

示例代碼:
??先聲明關聯的activity,然后直接寫 onclick 方法名,然后按下自動完成代碼的快捷鍵,就會提示在對應的activity中創建該方法。
在這里插入圖片描述

3、tools:itemCount

說明
應用范圍<RecyclerView>
作用對象Android Studio 布局編輯器
具體作用在 <RecyclerView> 節點中設置該屬性之后,會指定在預覽界面中繪制/展示幾個條目
取值說明int 類型數值

示例代碼:
??預覽界面展示 4個 條目
在這里插入圖片描述

4、tools:layout

說明
應用范圍< fragment>
作用對象Android Studio 布局編輯器
具體作用聲明在預覽時將哪個布局文件填充到該Fragment
取值說明布局id 的引用值

示例代碼:
??在預覽時將 testlayout 這個布局文件填充到fragment。testlayout的布局中包含一個 RecyclerView,并通過 itemCount 設置的預覽時展示的條數為4(參考 tools:itemCount)
在這里插入圖片描述

5、tools:listitem 、 tools:listheader 、 tools:listfooter

說明
應用范圍<AdapterView>及其子類,如<ListView>
作用對象Android Studio 布局編輯器
具體作用指明 AdapterView在預覽界面中所展示的 條目、頭布局、腳步局
取值說明布局文件的引用

示例代碼:
在這里插入圖片描述
item_spinner.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayoutxmlns: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:gravity="center_vertical"android:orientation="horizontal"><ImageViewandroid:layout_width="@dimen/dp50"android:layout_height="@dimen/dp50"android:src="@drawable/logo"tools:ignore="ContentDescription"/><!--ignore 后面根由多個錯誤id時,用逗號分隔 ; --><TextViewandroid:id="@+id/tv_item_suspendRv"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginRight="@dimen/dp10"android:gravity="center_vertical"android:text="abc"tools:ignore="HardcodedText,RtlHardcoded"/><!--使用 tools:text 設置預覽文本--><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"tools:text="這是設置的預覽文本"/>
</LinearLayout>

注意
如果 條目布局中有 TextView及其子類控件
(1) 如果設置了 tools:text , 在預覽時會優先展示該值;
(2) 如果沒有設置 tools:text ,但設置了 android:text , 在預覽時就會展示android:text 的屬性值;
(3) 如果都沒有設置,則會默認使用 item1、item2 填充到 TextView中作為預覽文本

6、 tools:showIn

說明
應用范圍所有 <view> 的根節點(即 布局文件的根節點)
作用對象Android Studio 布局編輯器
具體作用聲明該布局文件將會被哪個布局通過 <include>引用。聲明之后,在對應的文件中不要忘了用 <include>引用
取值說明布局文件的引用

示例代碼:
??testlayout2.xml 將會被 testlayout 引用。

testlayout2.xml

<?xml version="1.0" encoding="utf-8"?>
<TextViewandroid:id="@+id/testFragment"xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="wrap_content"tools:showIn="@layout/testlayout"tools:text="預覽文本"></TextView>

testlayout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><include layout="@layout/testlayout2"/></LinearLayout>

通過這種方式我們在確認該布局文件在哪里使用了的時候就比較方便了。

7、 tools:menu

說明
應用范圍布局文件的根節點(Any root <View>
作用對象Android Studio 布局編輯器
具體作用聲明在預覽界面中 AppBar 將展示哪些菜單
取值說明menu文件的id,多個id 之間用逗號間隔。不需要任何前綴和后綴。The value can be one or more menu IDs, separated by commas (without @menu/ or any such ID prefix and without the .xml extension)

在這里插入圖片描述

注意:按照官方文檔的說明,可以傳入多個 menu id 。但是實際測試時發現,傳入多個時右上角并沒有什么不同的顯示。

8、 tools:minValue / tools:maxValue

說明
應用范圍<NumberPicker>
作用對象Android Studio 布局編輯器
具體作用為 NumberPicker 設置預覽時的最小值和最大值
取值說明int 型數值

示例說明:
在這里插入圖片描述

9、 tools:openDrawer

說明
應用范圍<DrawerLayout>
作用對象Android Studio 布局編輯器
具體作用在預覽界面中將 DrawerLayout 打開。
取值說明end、left、right、start。具體說明,參考下表
ConstantValueDescription
end800005Push object to the end of its container, not changing its size.
left3Push object to the left of its container, not changing its size.
right5Push object to the right of its container, not changing its size.
start800003Push object to the beginning of its container, not changing its size.

注意:
1、在 <DrawerLayout > 需要通過 layout_gravity 聲明哪一部分作為側拉窗口,其取值也是 end、start、left、right。
2、tools:openDrawer 的取值必須與側拉窗口的 layout_gravity 的取值一致

在這里插入圖片描述

<?xml version="1.0" encoding="utf-8"?><!--此處 openDrawer 的取值必須與側拉窗口的 layout_gravity 取值一致-->
<android.support.v4.widget.DrawerLayoutandroid:id="@+id/numberPicker"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"tools:openDrawer="right"><!--這是未展示側拉界面時的主體內容--><RelativeLayout android:layout_width="match_parent"android:layout_height="match_parent"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"tools:text="這是主內容"/></RelativeLayout><!--這是側拉窗口中的內容。必須通過 layout_gravity 屬性聲明這是一個側拉展示的內容--><RelativeLayoutandroid:layout_width="100dp"android:layout_height="match_parent"android:layout_gravity="right"android:background="#f2e67b"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:ems="1"tools:text="這是要側拉的東西"/></RelativeLayout>
</android.support.v4.widget.DrawerLayout>

10、 “@tools:sample/*” 資源

說明
應用范圍所有支持顯示 text 或者 image 的view控件(Any view that supports UI text or images)
作用對象Android Studio 布局編輯器
具體作用為View設置占位文本或圖片。這其實就是系統預置的一堆字符串和圖片資源,當你想設置預覽文本或者預覽圖片時,如果不想自己去定義,直接引用這些系統預置的字符串和圖片就可以了
取值說明參考下表
屬性值說明
@tools:sample/full_namesFull names that are randomly generated from the combination of @tools:sample/first_names and@tools:sample/last_names.
@tools:sample/first_namesCommon first names.
@tools:sample/last_namesCommon last names.
@tools:sample/citiesNames of cities from across the world.
@tools:sample/us_zipcodesRandomly generated US zipcodes.
@tools:sample/us_phonesRandomly generated phone numbers with the following format: (800) 555-xxxx.
@tools:sample/loremPlaceholder text that is derived from Latin.
@tools:sample/date/day_of_weekRandomized dates and times for the specified format.
@tools:sample/date/ddmmyy
@tools:sample/date/mmddyy
@tools:sample/date/hhmm
@tools:sample/date/hhmmss
@tools:sample/avatarsVector drawables that you can use as profile avatars.
@tools:sample/backgrounds/scenicImages that you can use as backgrounds.

示例代碼:

在下面的預覽圖中,圖標和文本都是直接引用的系統預置的。
在這里插入圖片描述

(三)、資源壓縮相關屬性 (Resource shrinking attributes)

??下面這些屬性,可以讓我們在 資源壓縮時確定哪些資源可以保留或者丟棄,也可以讓我們開啟嚴格模式的資源引用檢查。 The following attributes allow you to enable strict reference checks and declare whether to keep or discard certain resources when using resource shrinking

開啟資源壓縮時,在 module 的build.gradle 文件作如下修改:

android {buildTypes {release {shrinkResources true    //開啟資源壓縮。minifyEnabled 也必須為true,否則編譯不通過minifyEnabled true     //開啟代碼混淆/壓縮proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}
}

1、 tools:shrinkMode

說明
應用范圍<resources>
作用對象開啟了資源壓縮的構建工具Build tools with resource shrinking
具體作用指明 構建工具在壓縮資源時使用哪種模式:safe mode 、strict mode
取值說明safe、strict
模式說明
safe保留被顯示引用的,或者可能通過 Resources.getIdentifier() 被動態引用的資源
strict保留 resources 或者 代碼中 被顯示引用的資源

??默認是 safe 模式 (即shrinkMode="safe"). 如果想使用 strict 模式,需要在<resources>節點中顯示聲明 shrinkMode="strict",具體如下:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:shrinkMode="strict" />

??開啟 strict 模式之后, 可以使用 tools:keep 保留那些你不想被移除的資源, 或者使用tools:discard 直接移除資源

2、 tools:keep

說明
應用范圍<resources>
作用對象開啟了資源壓縮的構建工具
具體作用使用資源壓縮去移除未被使用的資源時,該屬性將允許你指明哪些資源可以被保留(比如一些通過Resources.getIdentifier() 間接引用的資源)
取值說明資源文件的引用

??使用時,在 resources 目錄下創建一個 xml 文件并指定名稱,如:res/raw/keep.xml。創建一個<resources> 節點,并為 tools:keep 賦值,其值代表將被保留的資源,多個資源之間使用逗號間隔,也可以使用 * 作為通配符,示例如下:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"    tools:keep="@layout/used_1,@layout/used_2,@layout/*_3" />

3、 tools:discard

說明
應用范圍<resources>
作用對象開啟了資源壓縮的構建工具
具體作用
取值說明
??當使用資源壓縮工具去除一些無用資源時,使用該屬性可以指明一些需要手動刪除的資源 (比如:被引用了但是未能生效的資源,或者 Gradle 插件誤引用了某些資源被引用).

??使用時,在 resources 目錄下創建一個 xml 文件并指定名稱,如:res/raw/keep.xml。創建一個<resources> 節點,并為 tools:keep 賦值,其值代表將被保留的資源,多個資源之間使用逗號間隔,也可以使用 * 作為通配符,示例如下:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"    tools:discard="@layout/unused_1" />

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/36263.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/36263.shtml
英文地址,請注明出處:http://en.pswp.cn/news/36263.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

年薪6.5萬美元|生物醫學老師獲美國耶魯大學博士后職位

I老師就職于雙非二本院校&#xff0c;希望通過出國研修以提升科研背景&#xff0c;在公派訪學和申請導師出資的博士后之間&#xff0c;其選擇了后者。最終我們落實了美國耶魯大學的職位&#xff0c;頭銜為Associate Research Scientist&#xff08;副研究科學家&#xff09;&am…

Selenium 自動化 | 案例實戰篇

Chrome DevTools 簡介 Chrome DevTools 是一組直接內置在基于 Chromium 的瀏覽器&#xff08;如 Chrome、Opera 和 Microsoft Edge&#xff09;中的工具&#xff0c;用于幫助開發人員調試和研究網站。 借助 Chrome DevTools&#xff0c;開發人員可以更深入地訪問網站&#xf…

Observability:識別生成式 AI 搜索體驗中的慢速查詢

作者&#xff1a;Philipp Kahr Elasticsearch Service 用戶的重要注意事項&#xff1a;目前&#xff0c;本文中描述的 Kibana 設置更改僅限于 Cloud 控制臺&#xff0c;如果沒有我們支持團隊的手動干預&#xff0c;則無法進行配置。 我們的工程團隊正在努力消除對這些設置的限制…

uniapp動態底部tab欄

實現思路&#xff1a; 創建一個js文件用來存放所有的tabbar,不同的數組表示不同的tabbar組合。 創建一個vue文件用來制作底部tabbar組件。 使用vuex存儲用戶的身份信息,根據身份信息切換tabbar組合。 具體步驟&#xff1a; 新建一個tabbar.js文件&#xff0c;將…

SpringBoot 整合MyBatis

整合MyBatis 官方文檔&#xff1a;http://mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/ Maven倉庫地址&#xff1a;https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter/2.1.3 整合測試 導入 MyBatis 所需要的…

數據結構筆記--優先隊列(大小根堆)經典題型

1--項目的最大利潤 題目描述&#xff1a; 輸入&#xff1a;正數數組 costs&#xff0c;costs[i] 表示項目 i 的花費&#xff1b;正數數組 profits&#xff0c;profits[i] 表示項目 i 的花費&#xff1b;正數 k 表示只能串行完成最多 k 個項目&#xff1b;m 表示擁有的資金&…

MySQL事務:確保數據完整性與并發性的關鍵

MySQL事務&#xff1a;確保數據完整性與并發性的關鍵 MySQL作為一種廣泛使用的開源關系型數據庫管理系統&#xff0c;具備強大的事務支持&#xff0c;以確保數據庫操作的一致性、隔離性和持久性。本文將深入探討MySQL中的事務概念、事務隔離級別以及事務的應用場景&#xff0c…

leetcode 516. 最長回文子序列(JAVA)題解

題目鏈接https://leetcode.cn/problems/longest-palindromic-subsequence/description/?utm_sourceLCUS&utm_mediumip_redirect&utm_campaigntransfer2china 目錄 題目描述&#xff1a; 暴力遞歸&#xff1a; 動態規劃&#xff1a; 題目描述&#xff1a; 給你一個…

Python學習過程筆記:主模塊(main) 異常處理 命令行參數解析 日志記錄 socket模塊 類的私有方法 字節字符串

文章目錄 1.Python中的主程序2.Python中的異常處理3.Python中的命令行參數解析4.Python中的日志記錄5.網絡編程socket模塊6.Python中的私有方法7.Python中的字節字符串 1.Python中的主程序 if __name__ __main__在Python中&#xff0c;if __name__ __main__ 是一個常見的代碼…

百日筑基篇——python爬蟲學習(一)

百日筑基篇——python爬蟲學習&#xff08;一&#xff09; 文章目錄 前言一、python爬蟲介紹二、URL管理器三、所需基礎模塊的介紹1. requests2. BeautifulSoup1. HTML介紹2. 網頁解析器 四、實操1. 代碼展示2. 代碼解釋1. 將大文件劃分為小的文件&#xff08;根據AA的ID數量劃…

簡單認識Zabbix監控系統及配置

文章目錄 一、zabbix概述1、定義2、zabbix監控原理3、監控對象4、zabbix的3種架構&#xff08;1&#xff09; C/S架構&#xff08;2&#xff09;分布式架構&#xff1a;zabbix-proxy-client架構&#xff08;3&#xff09; master-node-client架構 5、zabbix監控模式 二、部署za…

項目實戰 — 消息隊列(8){網絡通信設計①}

目錄 一、自定義應用層協議 &#x1f345; 1、格式定義 &#x1f345; 2、準備工作 &#x1f384;定義請求和響應 &#x1f384; 定義BasicArguments &#x1f384; 定義BasicReturns &#x1f345; 2、創建參數類 &#x1f384; 交換機 &#x1f384; 隊列 &#x1f38…

【網絡】傳輸層——TCP(滑動窗口流量控制擁塞控制延遲應答捎帶應答)

&#x1f431;作者&#xff1a;一只大喵咪1201 &#x1f431;專欄&#xff1a;《網絡》 &#x1f525;格言&#xff1a;你只管努力&#xff0c;剩下的交給時間&#xff01; 上篇文章對TCP可靠性機制講解了一部分&#xff0c;這篇文章接著繼續講解。 &#x1f3a8;滑動窗口 在…

Springboot 實踐(2)MyEclipse2019創建項目修改pom文件,加載springboot 及swagger-ui jar包

MyEclipse2019創建工程之后&#xff0c;需要添加Springboot啟動函數、添加application.yml配置文件、修改pom文件添加項目使用的jar包。 添加Springboot啟動函數 創建文件存儲路徑 &#xff08;1&#xff09;右鍵單擊“src/main/java”文件夾&#xff0c;彈出對話框輸入路徑…

Android 簡單的視頻、圖片壓縮工具

首頁需要壓縮的工具包 1.Gradle implementation com.iceteck.silicompressorr:silicompressor:2.2.3 2.添加相關權限&#xff08;手機得動態申請權限&#xff09; <uses-permission android:name"android.permission.READ_EXTERNAL_STORAGE"/> <uses-p…

05 - 研究 .git 目錄

查看所有文章鏈接&#xff1a;&#xff08;更新中&#xff09;GIT常用場景- 目錄 文章目錄 1. HEAD2. config3. refs4. objects 1. HEAD 2. config 3. refs 4. objects Git對象一共有三種&#xff1a;數據對象 blob、樹對象 tree以及提交對象 commit&#xff0c;這些對象都被保…

Vue 目錄結構 vite 項目

Vue3 項目常用的目錄結構和每個文件的作用【通過 vite 創建的項目】 vite目錄結構&#xff1a; dist // 打包后生成的文件目錄 node_modules // 環境依賴 public // 公共資源目錄 favicon.ico …

深入探析設計模式:工廠模式的三種姿態

深入探析設計模式&#xff1a;工廠模式的三種姿態 1. 簡單工廠模式1.1 概念1.2 案例1.3 優缺點 2. 抽象工廠模式2.1 概念2.2 案例&#xff1a;跨品牌手機生產2.3 優缺點 3. 超級工廠模式3.1 概念3.2 案例&#xff1a;動物園游覽3.3 優缺點 4. 總結 歡迎閱讀本文&#xff0c;今天…

go入門實踐四-go實現一個簡單的tcp-socks5代理服務

文章目錄 前言socks協議簡介go實現一個簡單的socks5代理運行與壓測抓包驗證 前言 SOCKS是一種網絡傳輸協議&#xff0c;主要用于客戶端與外網服務器之間通訊的中間傳遞。協議在應用層和傳輸層之間。 本文使用先了解socks協議。然后實現一個socks5的tcp代理服務端。最后&#…

英語詞法——代詞

代詞是用來代替名詞、起名詞作用的短語、分句和句子的詞。英語中代詞根據其意義和作用可分為九類:人稱代詞、物主代詞、反身代詞、相互代詞、指示代詞、疑問代詞、不定代詞、關系代詞和連接代詞。 第一節 人稱代詞 一、人稱代詞的形式和用法 人稱代詞單數復數第一人稱第二人…