久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

android:inputType=“textPassword"、“textVisiblePassw

Difference between android:inputType=quot;textPasswordquot;, quot;textVisiblePasswordquot;,quot;textWebPasswordquot; and quot;numberPasswordquot; in android?(android:inputType=“textPassword、“textVisiblePassword、“textWebPassword之間
本文介紹了android:inputType=“textPassword"、“textVisiblePassword"、“textWebPassword"之間的區(qū)別和“數(shù)字密碼"在安卓?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號(hào)..

誰能解釋一下兩者的區(qū)別

Can anyone explain the differences between the

   android:inputType="textPassword",
   android:inputType="textVisiblePassword",
   android:inputType="textWebPassword",
   android:inputType="numberPassword"

Android Layout 中的 EditText ViewGroup?

of EditText ViewGroup in Android Layout?

推薦答案

即使已經(jīng)回答了,我還是會(huì)在密碼差異方面添加更多細(xì)節(jié)InputType 變體:

Even though it has been already answered I'll add some more details to the differences in password InputType variations:

  1. android:inputType="textPassword":對應(yīng)TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_PASSWORD 即它允許您輸入一個(gè)作為密碼的字符串(隱藏并防止自動(dòng)完成和建議,除非明確設(shè)置).這個(gè)主要用于我們要輸入密碼的時(shí)候.
  2. android:inputType="textVisiblePassword":對應(yīng)TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_VISIBLE_PASSWORD 并且與前一個(gè)相同,但密碼是可見的(如果您想使用它來允許查看默認(rèn)密碼,因?yàn)樗鼤?huì)阻止自動(dòng)完成和建議,除非它們被明確設(shè)置 - 這是可取的也有辦法隱藏密碼)
  3. android:inputType="numberPassword":對應(yīng)TYPE_CLASS_NUMBER |TYPE_NUMBER_VARIATION_PASSWORDandroid:inputType="textPassword" 相同,但您只能輸入數(shù)字.考慮到如果你使用它,密碼不會(huì)那么強(qiáng),所以我不建議在處理敏感數(shù)據(jù)時(shí)使用它,除非它與其他類型的用戶身份驗(yàn)證一起使用.
  4. android:inputType="textWebPassword":對應(yīng)TYPE_CLASS_TEXT |TYPE_TEXT_VARIATION_WEB_PASSWORD 并具有與 android:inputType="textPassword" 相同的行為,但它旨在用于 Web 表單,即在瀏覽器頁面內(nèi)(任何從用戶).所以這不應(yīng)在 EditText 本機(jī)控件中使用.使用此方法的示例是通過包裝 WebView在 WebView 中禁用 Android 的 AutoSuggestion并更改 EditorInfo 輸入類型以在 onCreateInputConnection 方法中添加標(biāo)志 InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD.
  1. android:inputType="textPassword": Corresponds to TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD i.e. it allows you to enter a string that is taken as a password (hidden and preventing autocompletion and suggestions unless set explicitly). This one is mostly used when we want to enter passwords.
  2. android:inputType="textVisiblePassword": Corresponds to TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD and is the same as the previous one but the password is visible (useful if you want to use it to allow to see the password as default because it prevents the autocompletion and suggestions unless they are set explicitly - it is advisable to also have a way to hide the password)
  3. android:inputType="numberPassword": Corresponds to TYPE_CLASS_NUMBER | TYPE_NUMBER_VARIATION_PASSWORD same as android:inputType="textPassword" but you can only enter numbers. Take into account that if you use it the password will not be so strong, so I wouldn't recommend using it when dealing with sensitive data unless it is used along with another type of user authentication.
  4. android:inputType="textWebPassword": Corresponds to TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_WEB_PASSWORD and has the same behaviour as android:inputType="textPassword" but it is intended to be used in a web form i.e. inside a browser page (any web form control that takes input from a user). So this shall not be used in an EditText native control. An example of using this would be to disable AutoSuggestion from Android in a WebView by wrapping a WebView and changing EditorInfo input type to add the flag InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD inside the onCreateInputConnectionmethod.

作為從鏈接中截取的最后一個(gè)示例:

As an example of the last one taken from the link:

public class NoSuggestionsWebView extends WebView {
    ...

    @Override
    public InputConnection onCreateInputConnection(EditorInfo outAttrs)
    {
        InputConnection ic = super.onCreateInputConnection(outAttrs);

        outAttrs.inputType &= ~EditorInfo.TYPE_MASK_VARIATION; /* clear VARIATION type to be able to set new value */
        outAttrs.inputType |= InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD; /* WEB_PASSWORD type will prevent form suggestions */

        return ic;
    }
}

我希望現(xiàn)在很清楚區(qū)別,主要是 android:inputType="textPassword"android:inputType="textWebPassword"

I hope it is clear now the differences and mainly between android:inputType="textPassword" and android:inputType="textWebPassword"

這篇關(guān)于android:inputType=“textPassword"、“textVisiblePassword"、“textWebPassword"之間的區(qū)別和“數(shù)字密碼"在安卓?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Cut, copy, paste in android(在android中剪切、復(fù)制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數(shù)的數(shù)字)
Changing where cursor starts in an expanded EditText(更改光標(biāo)在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 欧美日韩免费在线观看 | 欧美激情一区二区 | 欧美三级a做爰在线观看 | www.久久久久 | 黄色小视频免费看 | 日韩欧美国产精品 | 精品乱子伦一区二区三区 | 日韩中文字幕 | 日本不卡免费 | 不卡免费视频 | 成人a毛片 | 91视频亚洲 | 欧美一级特黄视频 | 激情小说在线视频 | 在线h片| 成年人免费看片 | 一区二区三区在线免费观看 | 国产精品久久久久久久午夜 | 天堂成人网 | 欧美综合在线视频 | 红桃av在线 | 国产激情一区二区三区 | 中文字幕av一区二区 | 在线免费观看黄色片 | 天天草天天草 | av免费观看网站 | 亚洲激情欧美激情 | 天天爽夜夜操 | 99热1| 在线理论片 | 在线国产小视频 | 免费特级毛片 | 色综合久久综合 | 国产精品1234| 91看片在线 | 激情五月综合网 | 天堂色av | 久久久黄色片 | 在线观看一区 | 亚洲乱码在线观看 | 毛茸茸free性熟hd |