Android 使编辑文本全屏显示

Android 使编辑文本全屏显示,android,Android,当我想在editText上键入内容时,我想使它成为全屏 类似这样的内容: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"

当我想在editText上键入内容时,我想使它成为全屏

类似这样的内容:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".myActivity" >

    <EditText
        android:id="@+id/edtText1"
        android:layout_width="300dip"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_weight="1"
        android:ems="10"
        android:gravity="top"
        android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
        android:windowSoftInputMode="stateVisible|adjustResize"
        android:imeOptions="actionSend|flagNoEnterAction"
        android:maxLines="1" />

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="350dp"
        android:layout_height="150dp">
    </LinearLayout>

</RelativeLayout>

起初我什么都不做就可以做到这一点,但后来我尝试使用外置键盘——因为使用软键盘会阻止我的一些编辑文本——而且不会再出现这种情况

我试着让我的editText变大,并使用scrollView,但我的应用程序有一个小图标,如果我把scrollView放在上面,它就不能工作

我的XML代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".myActivity" >

    <EditText
        android:id="@+id/edtText1"
        android:layout_width="300dip"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_weight="1"
        android:ems="10"
        android:gravity="top"
        android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
        android:windowSoftInputMode="stateVisible|adjustResize"
        android:imeOptions="actionSend|flagNoEnterAction"
        android:maxLines="1" />

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="350dp"
        android:layout_height="150dp">
    </LinearLayout>

</RelativeLayout>

我不是把所有的东西都放在这里,我只是想让你看看

我想让
edtText1
成为我上面给出的一个例子


linearLayout1
是捕获签名的画布,如果我放置
scrollview
,我的
linearLayout1
将无法工作。(
scrollview
正在运行)

请将您的xml代码放在这里……您可以试试这个。我使用LockableScrollView处理了类似的需求。我认为这是由android操作系统自动完成的,只要屏幕上没有足够的空间打开键盘。