键盘打开或关闭时显示背景活动内容

时间:2018-06-18 09:54:13

标签: android android-layout android-softkeyboard

检查以下图片。

![background activity content showing while opening keyboard or close. first layout goes up it take mili second to open keyboard. Below Address field white part there is background activity content.] 1

清单文件

android:windowSoftInputMode="stateAlwaysHidden"

这是我的布局顶部视图。帮我解决这个问题。

 <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:clickable="true">

    <include
        android:id="@+id/top_bar"
        layout="@layout/top_bar_steps_form" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/top_bar">

        <FrameLayout
            android:id="@+id/root_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"
            android:orientation="vertical"
            android:visibility="visible">

            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fillViewport="true">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="bottom">

                    <LinearLayout
                        android:id="@+id/parent"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center|bottom"
                        android:orientation="vertical"
                        android:visibility="visible">


             </LinearLayout>
             </RelativeLayout>
            </ScrollView>
        </FrameLayout>
    </RelativeLayout>
    </RelativeLayout>

1 个答案:

答案 0 :(得分:0)

我使用的是透明主题Theme.AppCompat.Translucent 我只是改变主题并修复了