久久久久久久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爰片毛片免费看108 | 99国产精品一区二区三区 | 亚洲视频国产视频 | 九热在线 | 国产精品18久久久久久白浆动漫 | 亚洲性人人天天夜夜摸 | 欧美影院 | 久久综合一区二区三区 | 91看片在线观看 | 中文字幕在线视频精品 | 欧美韩一区二区 | 欧美中文字幕一区二区三区亚洲 | 亚洲三级av | 亚洲精品一区二三区不卡 | 亚洲高清视频在线观看 | 免费黄色片在线观看 | 亚洲精品小视频在线观看 | 欧美日韩亚洲一区 | 四虎永久在线精品免费一区二 | 精品欧美乱码久久久久久1区2区 | 久久中文视频 | 欧美一级片在线观看 | 欧美精品一区在线 |