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

EditText 在旋轉時翻倍

EditText doubling out on rotate(EditText 在旋轉時翻倍)
本文介紹了EditText 在旋轉時翻倍的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我遇到了 EditText 控件的問題.這個問題只發生在這個特定的活動上,沒有其他帶有 EditTexts 的活動.我已刪除此 EditText 的所有 setText 調用,但問題仍然存在.

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.

我在移動設備上運行 Android 2.3.4.它是 Nexus S 和運行庫存的 Android.在模擬器中(運行 Android 2.2)不會出現這個問題.

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.

當我旋轉手機時,Android 會自動替換旋轉前 EditText 中的文本.我沒有使用 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.

我的問題:

假設test"一詞在 EditText 中.當我旋轉手機時,Android 會在重新創建 Activity 時將testtest"放入 EditText.這在我使用虛擬鍵盤鍵入 EditText 時發生,我沒有單擊虛擬鍵盤上的完成"按鈕,我按下返回以移除虛擬鍵盤,然后旋轉設備.如果我使用完成"按鈕而不是返回按鈕,則不會出現問題.

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.

有什么想法嗎?正如我所說,我設置文本.所有調用 setText 的行都被注釋掉了.

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

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

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

更新 3:除了 EditText 之外,我已經從布局中刪除了所有內容.問題仍然存在.

推薦答案

我也遇到過類似的問題,但只有在 EditText 的 AutoComplete 開啟時才能看到.

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

我的解決方法是禁用自動完成功能.

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

這篇關于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問題)
主站蜘蛛池模板: 国产精品资源在线 | 国产成人免费视频网站高清观看视频 | 黄色一级毛片 | 日韩喷潮| 久久久青草婷婷精品综合日韩 | 精品久久久久久久久久 | 婷婷色在线 | 在线中文视频 | 欧美日韩国产一区二区三区 | 最新中文字幕在线 | 99re在线观看 | 国产一区二区精品在线观看 | 精品免费视频 | 精品欧美一区二区在线观看视频 | 午夜网站视频 | av片在线观看网站 | 久久精品黄色 | 国产一区二区三区高清 | 色婷婷狠狠 | 成人午夜电影网 | 国产精品国产成人国产三级 | 黄色在线免费观看 | 欧美成人久久 | 国产视频精品视频 | 久久国产精品-久久精品 | 成人精品影院 | 国产精品久久久久久婷婷天堂 | 精品国产不卡一区二区三区 | 性福视频在线观看 | 一区二区三区国产好 | 欧美视频免费在线 | 国产精品大片 | 久久欧美精品 | 欧洲亚洲一区二区三区 | 国产乱码精品一区二区三区五月婷 | 在线视频亚洲 | 国产欧美日韩在线播放 | 成人免费看片 | 男人av在线播放 | 黑人精品| 一区二区三区国产精品 |