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

在Android中的EditText上強制全屏

Force FullScreen on EditText in Android(在Android中的EditText上強制全屏)
本文介紹了在Android中的EditText上強制全屏的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我目前正在開發一個使用 Samsung Galaxy Tab 2 作為設備的應用程序.

I am currently developing an app with Samsung Galaxy Tab 2 as my device.

我在 XML 中的代碼是:

My Code in the XML is:

<EditText
    android:id="@+id/analysis_text"
    style="@style/icon_text"
    android:imeOptions="actionDone"
    android:inputType="textMultiLine"
    android:onClick="onBtnClicked"
/>

當此代碼執行時,全屏數據輸入模式(提取模式)僅在某些情況下自動觸發.

When this code executes, the full screen data entry mode (Extract Mode) is triggered automatically only in certain situations.

我希望我的用戶在此控件中編輯文本時獲得完整的數據輸入屏幕,無論控件的屏幕或位置如何.

I would like my users to get a full data entry screen while editing text in this control, regardless of the screen or positioning of the control.

這個問題的另一種說法:無論內容是什么,如何在我的活動中為 EditText 框強制全屏數據輸入模式?

Another rephrase of this question: How do I force full screen data entry mode for EditText boxes in my activity no matter what the content is?

推薦答案

我解決了這個問題,并沒有真正解決,但找到了有效的解決方法.

I solved this issue, not really solved, but found a valid work-around.

解決方法是我設計了一個文本編輯器(看起來類似于全屏 UI),并在單擊每個 EditBoxes 時觸發新的 UI 活動(使用 startActivityForResult() 以便在完成后將控制權交還給調用活動),并在完成編輯后將文本傳輸回主屏幕.

The workaround is that I designed a text editor (which looks similar to the fullscreen UI) and on click of each of those EditBoxes the new UI activity is triggerred (with the startActivityForResult() so that once they are completed control is handed back to the calling activity) and after completion of edit the text is transferred back into the main screen.

我還確保那些轉移控制權的框不會獲得焦點,以便它們立即將控制權轉移到新 UI.

I also ensured that those boxes which transfer the control do not take focus so that they immediately transfer control to the new UI.

通過這種方式,我已經能夠實現一個取消按鈕,它現在實際上允許用戶返回而不保存他意外所做的更改.

This way I have been able to implement a cancel button, which now actually allows the user to go back without saving the changes he accidentally makes.

我對新想法持開放態度,但這對我很有用.

I am open to new ideas, but this has worked for me.

Activity中的代碼:

public void onBtnClicked(View v) {
    EditText current_text_box = (EditText) v;

    Intent intent = new Intent(ObservationActivity.this,
            TexteditorActivity.class);
    intent.putExtra("start_text", current_text_box.getText().toString());
    intent.putExtra("start_position", current_text_box.getSelectionStart());
    startActivityForResult(intent, v.getId());
} 

XML 中的代碼:

<EditText
    android:id="@+id/observation_text"
    style="@style/icon_text"
    android:focusable="false"
    android:imeOptions="flagNoExtractUi"
    android:inputType="textMultiLine"
    android:onClick="onBtnClicked" >
</EditText>

要創建我使用代碼的全屏 UI,您可以使用任何類似 (http://android-richtexteditor.googlecode.com/)

To create the full screen UI I used code, you can use any like (http://android-richtexteditor.googlecode.com/)

這篇關于在Android中的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問題)
主站蜘蛛池模板: 久久视频精品 | 手机在线观看 | 国产精品久久av | 欧美日韩高清在线一区 | 成年人免费网站 | 午夜播放器在线观看 | 久久国色 | 久久精品小视频 | 特a毛片 | 国产成人精品a视频一区www | 久久高清 | 亚洲天堂av在线 | a在线免费观看视频 | 久久se精品一区精品二区 | 性色av香蕉一区二区 | 日韩精品1区2区3区 爱爱综合网 | 黑人精品欧美一区二区蜜桃 | 久久国| 久久精品亚洲成在人线av网址 | 香蕉大人久久国产成人av | 天堂资源最新在线 | 国产精品日本一区二区不卡视频 | 国产精品资源在线观看 | 三级av在线 | 欧美a区 | 另类一区 | 国产精品3区 | www.色午夜.com | 狠狠综合网 | 国产不卡一区在线观看 | 午夜不卡一区二区 | 97超碰人人草 | 午夜资源 | 亚洲福利av| 亚洲欧美中文字幕在线观看 | 欧美成年人视频在线观看 | 久久九九网站 | 伊人99 | 在线视频成人 | 成人中文字幕在线观看 | 精品国产乱码久久久久久a丨 |