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

EditText 在旋轉(zhuǎn)時(shí)翻倍

EditText doubling out on rotate(EditText 在旋轉(zhuǎn)時(shí)翻倍)
本文介紹了EditText 在旋轉(zhuǎn)時(shí)翻倍的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

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

我遇到了 EditText 控件的問(wèn)題.這個(gè)問(wèn)題只發(fā)生在這個(gè)特定的活動(dòng)上,沒(méi)有其他帶有 EditTexts 的活動(dòng).我已刪除此 EditText 的所有 setText 調(diào)用,但問(wèn)題仍然存在.

I'm having an issue with an EditText control. This issue is only happening on this particular Activity and no other Activities with EditTexts. I have removed all setText calls for this EditText and the problem still persists.

我在移動(dòng)設(shè)備上運(yùn)行 Android 2.3.4.它是 Nexus S 和運(yùn)行庫(kù)存的 Android.在模擬器中(運(yùn)行 Android 2.2)不會(huì)出現(xiàn)這個(gè)問(wèn)題.

I am running Android 2.3.4 on my mobile device. It is a Nexus S and running stock Android. In the emulator (running Android 2.2) this problem does not occur.

當(dāng)我旋轉(zhuǎn)手機(jī)時(shí),Android 會(huì)自動(dòng)替換旋轉(zhuǎn)前 EditText 中的文本.我沒(méi)有使用 savedInstanceState 做任何事情.Android 本身就是這樣做的.

When I rotate the phone, Android automatically replaces the text that was in the EditText before the rotation. I'm not using savedInstanceState to do anything. Android is doing this itself.

我的問(wèn)題:

假設(shè)test"一詞在 EditText 中.當(dāng)我旋轉(zhuǎn)手機(jī)時(shí),Android 會(huì)在重新創(chuàng)建 Activity 時(shí)將testtest"放入 EditText.這在我使用虛擬鍵盤(pán)鍵入 EditText 時(shí)發(fā)生,我沒(méi)有單擊虛擬鍵盤(pán)上的完成"按鈕,我按下返回以移除虛擬鍵盤(pán),然后旋轉(zhuǎn)設(shè)備.如果我使用完成"按鈕而不是返回按鈕,則不會(huì)出現(xiàn)問(wèn)題.

Suppose the word "test" is in the EditText. When I rotate the phone, Android will place "testtest" into the EditText when the Activity is re-created. This only happens when I use the virtual keyboard to type into the EditText, I do not click the "done" button on the virtual keyboard, I press back to remove the virtual keyboard, and I then rotate the device. If I use the "done" button instead of the back button, the problem does not occur.

有什么想法嗎?正如我所說(shuō),我設(shè)置文本.所有調(diào)用 setText 的行都被注釋掉了.

Any ideas? As I said, I am NOT setting the text. All lines that call setText have been commented out.

更新 1:我已經(jīng)注釋掉了這個(gè) Activity 中的所有內(nèi)容,除了 onCreate() 方法.問(wèn)題仍然存在.

更新 2:我創(chuàng)建了一個(gè)新 Activity.這個(gè)全新的 Activity 只有一個(gè) onCreate() 方法.onCreate() 方法中唯一的事情是調(diào)用 setContentView(使用相同的布局文件)并調(diào)用 super 的 onCreate().問(wèn)題仍然存在.我難住了.我唯一能猜到的是布局文件有些古怪.我不知道那會(huì)是什么.

更新 3:除了 EditText 之外,我已經(jīng)從布局中刪除了所有內(nèi)容.問(wèn)題仍然存在.

推薦答案

我也遇到過(guò)類(lèi)似的問(wèn)題,但只有在 EditText 的 AutoComplete 開(kāi)啟時(shí)才能看到.

I had a similar problem but I only see it when the AutoComplete is turned on for the EditText.

我的解決方法是禁用自動(dòng)完成功能.

My work around was to disable autocomplete. <EditText . . . android:inputType="textMultiLine|textNoSuggestions" />

這篇關(guān)于EditText 在旋轉(zhuǎn)時(shí)翻倍的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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)在展開(kāi)的 EditText 中的開(kāi)始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問(wèn)題)
主站蜘蛛池模板: 国产黄色在线观看 | 国产高清一区二区三区 | 久久看片| 亚洲成人免费在线 | 精品91视频| 久久午夜精品福利一区二区 | 亚洲精品无 | 亚州毛片 | 亚洲天堂av在线 | 日本h片在线观看 | 人人艹人人爽 | 91在线第一页 | 99av成人精品国语自产拍 | 成人免费视频在线观看 | 国产97视频在线观看 | 亚洲国产欧美日韩 | www.日韩av.com| 亚洲三级av | 精品久久伊人 | 日日碰狠狠躁久久躁婷婷 | 日韩字幕一区 | 男人天堂手机在线视频 | 久久精品毛片 | 亚洲午夜视频 | 欧美午夜精品 | 人人澡人人射 | 日本一区二区不卡 | 久久久久久亚洲精品 | 欧美日本在线 | 久久精品—区二区三区 | 久久亚洲天堂 | 久久久www成人免费无遮挡大片 | 国产小视频在线 | 色综合一区 | 一级a爱片性色毛片免费 | 亚洲一区二区三区四区五区中文 | 在线中文字幕亚洲 | 久久在线视频 | 亚洲国产精品久久人人爱 | 国产欧美一区二区三区在线播放 | 国产一区二区三区久久久久久久久 |