强制全屏幕上的EditText Android中 [英] Force FullScreen on EditText in Android

查看:554
本文介绍了强制全屏幕上的EditText Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发与三星Galaxy Tab 2的应用程序为我的设备。

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

我的code的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"
/>

在此code执行,全屏数据输入模式(摘录模式)自动只在某些情况下引发的。

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)和点击其中每个的编辑框上课的新UI活动triggerred(与 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.

我还确保了那些传送控制框不接受焦点,让他们立即控制权转移到新的用户界面。

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.

code。在活动

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

code的XML:

Code in 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我用code,可以使用任何像( HTTP://android-richtexteditor.google$c$c.com/

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

这篇关于强制全屏幕上的EditText Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆