久久久久久久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:禁用拼寫檢查和自動換行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

在運行 Android 4.0(冰淇淋三明治)的 Android 模擬器上進行測試時,我注意到 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 完成的,它確實可以工作.這是實現無自動換行的必要代碼:

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);

這篇關于Android Ice Cream Sandwich Edittext:禁用拼寫檢查和自動換行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
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 位小數的數字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 欧美一级片在线观看 | 另类亚洲视频 | 超碰操 | 国产午夜久久 | 成人精品鲁一区一区二区 | 亚洲欧美日韩国产综合 | 成人性视频在线 | 国产视频欧美 | 免费毛片网站 | 日韩国产黄色片 | 久久久妇女国产精品影视 | 欧美久久久久 | 国产精品久久久久久久久久久久午夜片 | 久久逼逼 | 欧美专区在线视频 | 精品欧美一区二区精品久久 | 亚洲成网 | 一区二区三区国产 | 日韩成人性视频 | 精品粉嫩aⅴ一区二区三区四区 | 国产日韩欧美 | 日本亚洲一区二区 | 大陆一级毛片免费视频观看 | av免费观看在线 | 天天射中文 | 国产午夜精品福利 | 国产欧美一区二区精品忘忧草 | 免费看黄色国产 | 国产精品视频导航 | 欧美一区免费在线观看 | 国产日韩精品一区 | 精品免费| 亚洲一区二区成人 | 精品人伦一区二区三区蜜桃网站 | 国产在线精品一区二区三区 | 成人在线视频网址 | 综合网伊人 | 亚洲精品视频一区二区三区 | 国精日本亚洲欧州国产中文久久 | 男女网站视频 | 91一区二区三区 |