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

Android Ice Cream Sandwich Edittext:禁用拼寫檢查和自動

Android Ice Cream Sandwich Edittext: Disabling Spell Check and Word Wrap(Android Ice Cream Sandwich Edittext:禁用拼寫檢查和自動換行)
本文介紹了Android Ice Cream Sandwich Edittext:禁用拼寫檢查和自動換行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時送ChatGPT賬號..

在運行 Android 4.0(冰淇淋三明治)的 Android 模擬器上進(jìn)行測試時,我注意到 Edittext 做了一些非常奇怪的事情.

Whilst testing on the Android Emulator running Android 4.0 (Ice Cream Sandwich), I have noticed that the Edittext does some quite strange things.

首先,它會在每個被識別為拼寫錯誤"的單詞下劃線.紅色的.如何禁用此功能?其次,雖然我在布局 XML 中指定了 android:scrollHorizo??ntally=true" 自動換行:我該如何禁用它呢?這是 Edittext 的 Layout XML 代碼:

Firstly, it underlines every word identified as "misspelt" in red. How do I disable this? Secondly, although in the layout XML I have specified android:scrollHorizontally="true" word-wrap is enabled: how do I disable this as well? Here is the Layout XML code for the Edittext:

    <EditText
        android:id="@+id/editor"
        android:layout_width="40dp"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/toolbar"
        android:layout_toRightOf="@+id/toolbarleft"
        android:paddingBottom="0dp"
        android:paddingRight="0dp"
        android:scrollHorizontally="true"
        android:text=""
        android:inputType="textMultiLine" >
        
        <requestFocus />
    </Edittext>

這是我需要禁用的拼寫檢查器示例:

Here is an example of the spell checker I need to disable:


(來源:abstract-thoughts.com)

非常感謝!

推薦答案

禁用拼寫檢查
為了擺脫拼寫檢查,您必須在 XML 中指定 EditText 的 InputType,如下所示:

Disabling Spell-Checking
In order to get rid of spell checking you must specify the EditText's InputType in the XML as the following:

android:inputType="textNoSuggestions"

但是,我的 EditText 也需要是多行的,所以我在 EditText 的 XML 中添加了以下行:

However, my EditText needed also to be multiline, so I have added the following line to the EditText's XML:

android:inputType="textMultiLine|textNoSuggestions"

禁用自動換行
如前所述,XML 屬性 android:scrollHorizo??ntally="true" 不起作用.然而,奇怪的是,如果它是通過 Java 完成的,它確實可以工作.這是實現(xiàn)無自動換行的必要代碼:

mEditText.setHorizo??ntallyScrolling(true);

Disabling Word-Wrap
As noted, the XML attribute android:scrollHorizontally="true" does not work. However, strangely, if it is done through Java it does work. Here is the necessary code to achieve no word wrapping:

mEditText.setHorizontallyScrolling(true);

這篇關(guān)于Android Ice Cream Sandwich Edittext:禁用拼寫檢查和自動換行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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問題)
主站蜘蛛池模板: 中文字幕在线观看网址 | 自拍偷拍一区二区三区 | 午夜视频一区二区 | 久久香蕉国产 | 欧美日韩激情 | 亚洲成人免费在线 | 亚洲激情五月 | 欧美久久久 | 97超碰人人 | 成人在线黄色 | 亚洲17p| 欧美a级成人淫片免费看 | 激情婷婷 | 国产一区在线视频 | 在线观看三级 | 伊人网综合| 毛茸茸性猛交xxxx | 高清国产mv在线观看 | 午夜激情视频在线观看 | 国产欧美精品一区二区 | 欧美日韩视频在线 | 国产福利小视频 | 亚洲精品成人网 | 天天干天天操天天干 | 亚洲一区二区欧美 | 一级片在线免费观看 | 国产日批视频 | 乱色av| 一道本av| 亚洲精品成人网 | 国产精品一区二区三 | 特级西西444www大胆免费看 | 国产日韩视频 | 黄色午夜| 99久久久国产精品 | 视频在线一区 | 欧美性色网| 免费看的黄色片 | 特级特黄aaaa免费看 | 成人免费看片&#39; | 一区二区视频在线 |