Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.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 在InputView上单击时布局被拉伸(显示键坏)_Android_Layout_Imageview_Stretch - Fatal编程技术网

Android 在InputView上单击时布局被拉伸(显示键坏)

Android 在InputView上单击时布局被拉伸(显示键坏),android,layout,imageview,stretch,Android,Layout,Imageview,Stretch,我有一个小问题与布局有关,当键盘点击InputView时,布局会拉伸 这是单击ImageView之前布局的外观: 以下是布局的外观: 如您所能,布局将移动 [编辑]以上XML布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pare

我有一个小问题与布局有关,当键盘点击InputView时,布局会拉伸

这是单击ImageView之前布局的外观:

以下是布局的外观:

如您所能,布局将移动

[编辑]以上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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_margin="10dp"
    android:orientation="vertical"
    android:weightSum ="10">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_margin="3dp"
        android:orientation="horizontal"
        android:layout_weight="1">
        <ImageView
            android:id="@+id/imgGameStatus"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
        <TextView
            android:id="@+id/txtGameStatus"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="7"
            android:layout_gravity="center_vertical"
            android:text="Status..."/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_margin="3dp"
        android:orientation="horizontal"
        android:layout_weight="1">

        <TextView
            android:id="@+id/txtInvite"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="@string/lib_choose_number"
            android:layout_gravity="center_vertical"
            android:layout_weight="7"/>

        <EditText
            android:id="@+id/edtNumber"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:maxLength="4"
            android:inputType="number"
            android:paddingRight="4dp"
            android:layout_gravity="center_vertical"
            android:layout_weight="2" />

        <Button
            android:id="@+id/btnSend"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_weight="3"
            android:text="@string/lib_send"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_margin="3dp"
        android:gravity="center"
        android:orientation="horizontal"
        android:layout_weight="1">

        <Button
            android:id="@+id/imgBtn0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="0"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="1"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="2"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="3"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="4"
            android:layout_weight="1"
            android:background="@color/green"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_margin="3dp"
        android:gravity="center"
        android:orientation="horizontal"
        android:layout_weight="1">

        <Button
            android:id="@+id/imgBtn5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="5"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn6"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="6"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn7"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="7"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn8"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="8"
            android:layout_weight="1"
            android:background="@color/green"/>

        <Button
            android:id="@+id/imgBtn9"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="9"
            android:layout_weight="1"
            android:background="@color/green"/>
    </LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_margin="3dp"
    android:gravity="center"
    android:orientation="horizontal"
    android:layout_weight="5">

    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>

</LinearLayout>

</LinearLayout>

</RelativeLayout>


请提供帮助。

我猜,当您的空列表视图被键盘向上推时,它会向上推按钮

插入

android:windowSoftInputMode="stateHidden|adjustNothing"
android:windowSoftInputMode="stateHidden|adjustNothing"
在清单中的活动中,如下所示:

    <activity
        android:name=".activities.MyActivity"
        android:windowSoftInputMode="stateHidden|adjustNothing">
    </activity>
<activity
    android:name=".activities.MyActivity"
    android:windowSoftInputMode="stateHidden|adjustNothing">
</activity>

插入

在清单中的活动中,如下所示:

    <activity
        android:name=".activities.MyActivity"
        android:windowSoftInputMode="stateHidden|adjustNothing">
    </activity>
<activity
    android:name=".activities.MyActivity"
    android:windowSoftInputMode="stateHidden|adjustNothing">
</activity>


发布您的布局xml文件。您的建议非常适合我。谢谢。你能接受你问题的答案吗:)