键盘显示为Android

时间:2018-08-25 03:40:17

标签: android android-edittext android-softkeyboard

我正在处理固定的标题,当按焦点edittext->键盘时,不会按标题,而只会按内容。我的问题是,当我使用 fullscreen + Adjustsize 代码时,保留标题,但内容被键盘覆盖,我在xml中添加fitsystemwindow,但是当键盘隐藏空白时在底部确保您隐藏导航。因此,如何保持标题不是滚动,而是全屏显示,隐藏导航。谢谢 embedded image

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layoutCRC"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/base"
android:baselineAligned="false"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:weightSum="1">

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


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginBottom="12dp"
                android:layout_marginTop="10dp"
                android:layout_marginLeft="@dimen/layout_marginLeftPL"
                android:layout_marginRight="@dimen/layout_marginRightPL"
                android:layout_weight="0.23"
                android:background="@drawable/layout_crc"
                android:orientation="vertical"
                android:weightSum="3">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginBottom="5dp"
                    android:layout_marginTop="5dp"
                    android:layout_weight="1.35"
                    android:gravity="center"
                    android:orientation="horizontal">

                    <com.fecredit.hostedkios.widgets.TextViewPlus
                        android:id="@+id/textView5"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:layout_marginTop="5dp"
                        android:layout_marginBottom="5dp"
                        android:text="@string/textOCredit"
                        android:textColor="@color/colortext_loan"
                        android:textSize="@dimen/textSize"
                        android:textStyle="bold"
                        app:font="@string/FtraBd" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1.1"
                    android:orientation="vertical"
                    android:weightSum="2">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_gravity="center_vertical"
                        android:layout_marginLeft="20dp"
                        android:layout_weight="1.5"
                        android:gravity="center_vertical"
                        android:orientation="vertical">

                        <com.fecredit.hostedkios.widgets.TextViewPlus
                            android:id="@+id/textView6"
                            android:layout_width="wrap_content"
                            android:layout_height="30dp"
                            android:gravity="center_vertical"
                            android:text="@string/textStep1"
                            android:textColor="@color/colorButton"
                            android:textSize="@dimen/textSizeContentPL"
                            android:textStyle="bold"
                            app:font="@string/SVN" />

                    </LinearLayout>

                    <RadioGroup
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="20dp"
                        android:layout_weight="0.5"
                        android:orientation="vertical"
                        android:weightSum="2">

                        <com.fecredit.hostedkios.widgets.RadioButtonPlus
                            android:id="@+id/radioPayroll"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:layout_weight="0.9"
                            android:buttonTint="@color/colortext_loan"
                            android:text="@string/textpayroll"
                            android:textColor="@color/colorButton"
                            app:radiofont="@string/FtraBk" />

                        <com.fecredit.hostedkios.widgets.RadioButtonPlus
                            android:id="@+id/rdbVehicleRegistration"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_weight="1.1"
                            android:buttonTint="@color/colortext_loan"
                            android:gravity="center_vertical"
                            android:text="@string/textcarparachute"
                            android:textColor="@color/colorButton"
                            app:radiofont="@string/FtraBk" />
                    </RadioGroup>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="5dp"
                    android:layout_weight="0.55"
                    android:orientation="vertical"
                    android:weightSum="4">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_weight="1.1"
                        android:orientation="horizontal">

                        <com.fecredit.hostedkios.widgets.TextViewPlus
                            android:layout_width="match_parent"
                            android:layout_height="30dp"
                            android:layout_marginBottom="15dp"
                            android:layout_marginLeft="20dp"
                            android:layout_marginRight="20dp"
                            android:gravity="center_vertical"
                            android:text="@string/step2"
                            android:textColor="@color/colorButton"
                            android:textSize="@dimen/textSizeContentPL"
                            android:textStyle="bold"
                            app:font="@string/SVN" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginBottom="25dp"
                        android:layout_marginLeft="20dp"
                        android:layout_marginRight="20dp"
                        android:layout_weight="0.97"
                        android:orientation="horizontal">

                        <LinearLayout
                            android:id="@+id/lvname"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_marginRight="30dp"
                            android:layout_weight="0.5"
                            android:gravity="center_vertical">

                            <com.fecredit.hostedkios.widgets.EditTextViewPlus
                                android:id="@+id/edtFullNameCRC"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:background="@drawable/custom_input"
                                android:hint="@string/name"
                                android:imeOptions="actionNext"
                                android:inputType="textNoSuggestions"
                                android:nextFocusForward="@+id/edtPhoneCRC"
                                android:paddingBottom="7dp"
                                android:paddingLeft="10dp"
                                android:paddingRight="5dp"
                                android:paddingTop="7dp"
                                android:textColorHint="@color/colorButton"
                                app:editfont="@string/FtraBk" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_marginLeft="30dp"
                            android:layout_weight="0.5"
                            android:gravity="center_vertical">

                            <com.fecredit.hostedkios.widgets.EditTextViewPlus
                                android:id="@+id/edtIndentifyCRC"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:background="@drawable/custom_input"
                                android:hint="@string/ID"
                                android:imeOptions="actionNext"
                                android:inputType="numberPassword"
                                android:maxLength="12"
                                android:nextFocusForward="@+id/edtEmailCRC"
                                android:paddingBottom="7dp"
                                android:paddingLeft="10dp"
                                android:paddingRight="5dp"
                                android:paddingTop="7dp"
                                android:textColorHint="@color/colorButton"
                                app:editfont="@string/FtraBk" />
                        </LinearLayout>
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginBottom="25dp"
                        android:layout_marginLeft="20dp"
                        android:layout_marginRight="20dp"
                        android:layout_weight="0.97"
                        android:orientation="horizontal"
                        android:weightSum="1">

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_marginRight="30dp"
                            android:layout_weight="0.5"
                            android:gravity="center_vertical">

                            <com.fecredit.hostedkios.widgets.EditTextViewPlus
                                android:id="@+id/edtPhoneCRC"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:background="@drawable/custom_input"
                                android:hint="@string/phoneNumber"
                                android:imeOptions="actionNext"
                                android:inputType="numberPassword"
                                android:maxLength="11"
                                android:nextFocusForward="@+id/edtIndentifyCRC"
                                android:paddingBottom="7dp"
                                android:paddingLeft="10dp"
                                android:paddingRight="5dp"
                                android:paddingTop="7dp"
                                android:textColorHint="@color/colorButton"
                                app:editfont="@string/FtraBk" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_marginLeft="30dp"
                            android:layout_weight="0.5"
                            android:gravity="center_vertical">

                            <com.fecredit.hostedkios.widgets.EditTextViewPlus
                                android:id="@+id/edtEmailCRC"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:background="@drawable/custom_input"
                                android:hint="@string/email"
                                android:imeOptions="actionDone"
                                android:inputType="textEmailAddress"
                                android:paddingBottom="7dp"
                                android:paddingLeft="10dp"
                                android:paddingRight="5dp"
                                android:paddingTop="7dp"
                                android:textColorHint="@color/colorButton"
                                app:editfont="@string/FtraBk" />
                        </LinearLayout>

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginBottom="25dp"
                        android:layout_marginLeft="20dp"
                        android:layout_marginRight="20dp"
                        android:layout_weight="0.96"
                        android:orientation="horizontal"
                        android:weightSum="1">

                        <FrameLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_gravity="center_horizontal"
                            android:layout_marginRight="30dp"
                            android:layout_weight="0.5"
                            android:gravity="center_horizontal">

                            <com.fecredit.hostedkios.widgets.EditTextViewPlus
                                android:id="@+id/edtDateCRC"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:background="@drawable/custom_input"
                                android:focusable="false"
                                android:hint="@string/date"
                                android:inputType="textPersonName"
                                android:nextFocusForward="@+id/edtIndentifyCRC"
                                android:paddingBottom="7dp"
                                android:paddingLeft="10dp"
                                android:paddingRight="5dp"
                                android:paddingTop="7dp"
                                android:textColorHint="@color/colorButton"
                                app:editfont="@string/FtraBk" />

                            <ImageView
                                android:id="@+id/imgDateCRC"
                                android:layout_width="@dimen/imgDate"
                                android:layout_height="@dimen/imgHeightDate"
                                android:layout_gravity="right|center_vertical"
                                app:srcCompat="@drawable/calendarblack" />

                        </FrameLayout>

                        <FrameLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:layout_gravity="center_horizontal"
                            android:layout_marginLeft="30dp"
                            android:layout_weight="0.5"
                            android:gravity="center_vertical">

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="match_parent"
                                android:gravity="center_vertical">

                                <Spinner
                                    android:id="@+id/spinnerProvinceCRC"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_gravity="center_vertical"
                                    android:background="@drawable/custom_input"
                                    android:gravity="center"
                                    android:imeOptions="actionDone"
                                    android:inputType="textPersonName"
                                    android:paddingBottom="7dp"
                                    android:paddingTop="7dp"
                                    android:popupBackground="@drawable/custom_spinner"
                                    android:spinnerMode="dropdown"
                                    android:textColorHint="@color/colorButton" />

                            </LinearLayout>

                            <ImageView
                                android:id="@+id/imageView6"
                                android:layout_width="@dimen/imgDate"
                                android:layout_height="@dimen/imgHeightProvince"
                                android:layout_gravity="right|center_vertical"
                                app:srcCompat="@drawable/loction" />
                        </FrameLayout>
                    </LinearLayout>

                </LinearLayout>

            </LinearLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center_horizontal"
                android:layout_weight="0.77"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <FrameLayout
                    android:id="@+id/layoutFooter"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="125dp"
                        android:background="@drawable/thanhmain"
                        android:gravity="right">

                        <com.fecredit.hostedkios.widgets.ButtonPlus
                            android:id="@+id/btnSendCRC"
                            android:layout_width="@dimen/layout_widthButtonSelect"
                            android:layout_height="@dimen/layout_heightButtonSelect"
                            android:layout_gravity="center"
                            android:layout_marginBottom="17dp"
                            android:layout_marginRight="@dimen/layout_marginRightPL"
                            android:background="@drawable/custom_button"
                            android:text="@string/btnSend"
                            android:textAllCaps="false"
                            android:textColor="@color/colorWhite"
                            android:textSize="@dimen/textSizeButton"
                            android:textStyle="bold"
                            app:buttonfont="@string/FtraBd" />

                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginBottom="30dp">

                        <ImageView
                            android:id="@+id/imgBackCRC"
                            android:layout_width="@dimen/layout_widthImageBack"
                            android:layout_height="@dimen/layout_heightImageBack"
                            android:layout_gravity="center"
                            android:layout_marginBottom="5dp"
                            android:layout_marginLeft="30dp"
                            android:layout_marginRight="25dp"
                            app:srcCompat="@drawable/goback" />
                    </LinearLayout>

                </FrameLayout>
            </RelativeLayout>

    </LinearLayout>
</ScrollView>

0 个答案:

没有答案