Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果用户键入文本输入,Android AcityLayout将损坏_Android_Android Layout - Fatal编程技术网

如果用户键入文本输入,Android AcityLayout将损坏

如果用户键入文本输入,Android AcityLayout将损坏,android,android-layout,Android,Android Layout,我在我的应用程序中的一些设备上遇到了问题,如果用户开始在文本字段中键入文本,并且显示的虚拟键盘屏幕已损坏(请参见屏幕截图)。在某些设备上一切正常 我怎样才能解决这个问题 以下是布局的代码: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.andr

我在我的应用程序中的一些设备上遇到了问题,如果用户开始在文本字段中键入文本,并且显示的虚拟键盘屏幕已损坏(请参见屏幕截图)。在某些设备上一切正常

我怎样才能解决这个问题

以下是布局的代码:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:id="@+id/mainActLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <!-- LOGO BACKGROUND -->

    <ImageView
        android:id="@+id/logoBackgroundImg"
        android:layout_width="fill_parent"
        android:layout_height="150sp"
        android:background="@color/lighter_blue"
        android:scaleType="fitCenter" />

    <View
        android:layout_width="fill_parent"
        android:layout_height="5dp"
        android:layout_marginTop="150dp"
        android:background="@color/blue" />

    <!-- LOGO -->
    <ImageView
        android:id="@+id/logoImgIV"
        android:layout_width="300dp"
        android:layout_height="150dp"
        android:layout_gravity="center_horizontal"
        android:src="@drawable/appmainlogo" />

    <!-- EU FLAG IMG BUTTON -->
    <ImageButton
        android:id="@+id/euFlagImgBtn"
        android:layout_width="50dp"
        android:layout_height="70dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginRight="110dp"
        android:layout_marginTop="120dp"
        android:background="@color/green"
        android:scaleType="centerCrop"
        android:src="@drawable/euflag" />

    <!-- CAR PLATE ID TEXT INPUT -->

    <EditText
        android:id="@+id/carPlateIdEditText"
        android:layout_width="220dp"
        android:layout_height="70dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginLeft="25dp"
        android:layout_marginTop="120dp"
        android:background="@color/white"
        android:hint="@string/insert_car_plate_number"
        android:inputType="textCapCharacters"
        android:imeOptions="actionDone"
        android:paddingLeft="15dp"
        android:textAlignment="center"
        android:textSize="30sp" />

    <!-- SUBMIT BUTTON -->

    <Button
        android:id="@+id/submiBtn"
        android:layout_width="fill_parent"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_height="70dp"
        android:layout_gravity="bottom|center"
        android:layout_marginBottom="180dp"
        android:background="@color/lighter_blue"
        android:onClick="checkSpz"
        android:text="@string/check"
        android:textColor="@color/white"
        android:textSize="30sp"
        android:textStyle="bold" />

    <!-- FIRST ICON -->

    <TextView
        android:id="@+id/firstIconTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginBottom="90dp"
        android:layout_gravity="bottom|left"
        android:text="@string/icon_safe"
        android:textAlignment="center"
        android:textColor="@color/gray"
        android:textSize="80sp" />

    <!-- SECOND ICON -->

    <TextView
        android:id="@+id/secondIconTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="90dp"
        android:layout_gravity="bottom|center"
        android:text="@string/icon_quick"
        android:textColor="@color/gray"
        android:textSize="80sp" />

    <!-- THIRD ICON -->

    <TextView
        android:id="@+id/thirdIconTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="20dp"
        android:layout_marginBottom="90dp"
        android:layout_gravity="bottom|right"
        android:text="@string/icon_quality"
        android:textColor="@color/gray"
        android:textSize="80sp" />

<!-- HEADING TV -->

    <TextView
        android:id="@+id/safeDescTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginBottom="60dp"
        android:layout_gravity="bottom|left"
        android:text="@string/safe"
        android:textSize="20sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/quickDescTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center"
        android:layout_marginBottom="60dp"
        android:text="@string/quick"
        android:textSize="20sp"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/qualityDescTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:layout_marginRight="20dp"
        android:layout_marginBottom="60dp"
        android:text="@string/quality"
        android:textSize="20sp"
        android:textStyle="bold" />

</FrameLayout>


谢谢你的建议

您需要将scrollview设置为布局的根目录。然后使用以下代码段

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
通过舱单

android:windowSoftInputMode="adjustResize"

你的处理方式和我应该放在哪里的布局不一样?在onCreate和manifest In application标记中?我更喜欢以编程方式。@redrom我很高兴我能提供帮助:-)