我创建了一个带有EditText的表单和表单底部的按钮。如果您将焦点放在EditText键盘上,则会出现与按钮重叠的键盘。 Windows软输入模式:stateHidden | adjustPan。有没有办法让键盘不重叠按钮?
Screenshot1 http://i1204.photobucket.com/albums/bb408/krestor85/screen1_zpsjfmdlp9d.jpg
Screenshot2 http://i1204.photobucket.com/albums/bb408/krestor85/screen2_zpszy97utxy.jpg
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/login_bg"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/statusBar"
android:layout_width="match_parent"
android:layout_height="@dimen/albumstatusBarHeight"
android:background="?colorPrimaryDark"
android:translationZ="4dp" />
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
style="@style/ToolBarStyle.Event"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:background="@android:color/transparent"/>
<TextView
android:id="@+id/welcomeTxt"
android:text="@string/welcome"
style="@style/welcomeLabel"
>
</TextView>
<ImageView
android:id="@+id/logoApp"
android:src="@drawable/logo"
style="@style/logoImage">
</ImageView>
<TextView
android:id="@+id/verificationTxt"
android:text="@string/verification_text"
style="@style/VerificationTextStyle"
android:layout_marginTop="27dp"
>
</TextView>
<RelativeLayout
android:layout_marginTop="16dp"
android:id="@+id/countryField"
style="@style/VerificationFieldsStyle"
>
<TextView
android:id="@+id/countryTxtView"
style="@style/VerificationTextFieldsStyle"
android:layout_alignParentLeft="true"
android:text="@string/country_text"/>
<LinearLayout
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<TextView
android:id="@+id/countryNameView"
style="@style/VerificationTextFieldsStyle"
android:layout_marginRight="10dp"
android:text="@string/country_example"/>
<ImageView
android:id="@+id/moreImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:src="@drawable/more"
android:layout_gravity="center"/>
</LinearLayout>
</RelativeLayout>
<ImageView
android:src="@drawable/vertical_divider_shape"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"/>
<RelativeLayout
android:id="@+id/phoneField"
style="@style/VerificationFieldsStyle"
android:background="@drawable/verification_background_bottom"
>
<LinearLayout
android:id="@+id/phoneCodeLayout"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<TextView
android:id="@+id/countryPhoneCodeView"
style="@style/VerificationTextFieldsStyle"
android:text="@string/country_phone_code_example"
/>
<ImageView
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:src="@drawable/vertical_divider_shape"
/>
</LinearLayout>
<EditText
android:id="@+id/countryPhoneView"
style="@style/VerificationEditPhoneText"
android:inputType="phone"
android:layout_toRightOf="@+id/phoneCodeLayout"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<Button
android:id="@+id/loginButton"
style="@style/LoginButtonStyle"
android:layout_marginTop="34dp"
android:text="@string/login_button_text"
android:textColorLink="@color/login_color" />
</LinearLayout>
答案 0 :(得分:0)
尝试添加:
android:windowSoftInputMode="adjustPan|adjustResize"
到您的活动代码。