情况:
我有一个活动,目前有5个“屏幕”包裹在ViewFlipper中;在ViewFLipper下面我有一个蓝色条,它可以作为一个导航栏显示你所在的屏幕。
问题:
出现软键盘时,蓝色导航栏会显示在其上方。所以,我添加了android:softinputmode="adjustpan"
以保持导航栏在底部,现在我无法滚动视图,我的一些输入被阻止...任何帮助将不胜感激。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="horizontal"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_marginBottom="20dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<ViewFlipper android:layout_width="fill_parent"
android:id="@+id/CreateNewAccountViewFlipper"
android:layout_height="fill_parent">
<com.appname.UI.Shared.CreateNewAccount.NextBackScrollView
android:layout_width="fill_parent"
android:id="@+id/NextBackScrollView1"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TextView
android:padding="10dp"
android:text="@string/CreateNewAccountWelcomeMessage"
android:layout_width="fill_parent"
android:id="@+id/createNewAccountMessage"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_margin="20px"
android:gravity="center">
</TextView>
</LinearLayout>
</com.appname.UI.Shared.CreateNewAccount.NextBackScrollView>
<com.appname.UI.Shared.CreateNewAccount.NextBackScrollView
android:layout_width="fill_parent"
android:id="@+id/NextBackScrollView2"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TextView
android:padding="10dp"
android:gravity="center"
android:text="@string/CreateNewAccountEmailMessage"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:id="@+id/createNewAccountEmailMessage"
android:layout_height="wrap_content">
</TextView>
<EditText
android:inputType="textEmailAddress"
android:hint="Email Address"
android:id="@+id/newEmail"
android:selectAllOnFocus="true"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</EditText>
<EditText
android:inputType="textEmailAddress"
android:hint="Confirm Email Address"
android:id="@+id/newEmailConfirm"
android:selectAllOnFocus="true"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</EditText>
</LinearLayout>
</com.appname.UI.Shared.CreateNewAccount.NextBackScrollView>
<com.appname.UI.Shared.CreateNewAccount.NextBackScrollView
android:layout_width="fill_parent" android:id="@+id/NextBackScrollView3"
android:layout_height="fill_parent" android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TextView android:padding="10dp" android:gravity="center"
android:text="@string/CreateNewAccountPersonalInfoMessage"
android:layout_marginTop="20px" android:layout_width="match_parent"
android:id="@+id/createNewAccountPersonalInfoMessage"
android:layout_height="wrap_content">
</TextView>
<EditText
android:inputType="textPersonName"
android:hint="First Name"
android:id="@+id/newAccountFirstName"
android:selectAllOnFocus="true"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</EditText>
<EditText
android:inputType="textPersonName"
android:hint="Last Name"
android:id="@+id/newAccountLastName"
android:selectAllOnFocus="true"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</EditText>
<EditText
android:inputType="textPostalAddress"
android:hint="Street Address"
android:id="@+id/newAccountStreetAddress"
android:selectAllOnFocus="true"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</EditText>
<LinearLayout
android:orientation="horizontal"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<EditText
android:layout_weight="3"
android:maxLength="20"
android:hint="City"
android:id="@+id/newAccountCity"
android:selectAllOnFocus="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textPostalAddress">
</EditText>
<EditText
android:layout_weight="1"
android:maxLength="2"
android:hint="St"
android:id="@+id/newAccountState"
android:selectAllOnFocus="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textPostalAddress">
</EditText>
<EditText
android:layout_weight="2"
android:maxLength="5"
android:hint="Zip"
android:id="@+id/newAccountZipCode"
android:selectAllOnFocus="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textPostalAddress">
</EditText>
</LinearLayout>
</LinearLayout>
</com.appname.UI.Shared.CreateNewAccount.NextBackScrollView>
<com.appname.UI.Shared.CreateNewAccount.NextBackScrollView
android:layout_width="fill_parent"
android:id="@+id/NextBackScrollView4"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TextView
android:padding="10dp"
android:gravity="center"
android:text="@string/CreateNewAccountBusinessMessage"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:id="@+id/createNewAccountBusinessMessage"
android:layout_height="wrap_content">
</TextView>
<CheckBox
android:text="Is business account"
android:contentDescription="Is business account? Click for yes"
android:id="@+id/isNewBusinessAccountCheck"
android:layout_gravity="center"
android:layout_marginTop="20px"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</CheckBox>
<EditText
android:inputType="textPersonName"
android:hint="Business Name"
android:id="@+id/newAccountBusinessName"
android:selectAllOnFocus="true"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible">
<requestFocus></requestFocus>
</EditText>
<EditText
android:inputType="textPostalAddress"
android:hint="Mailing Address"
android:id="@+id/newAccountBusinessAddress"
android:selectAllOnFocus="true"
android:layout_marginTop="20px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible">
</EditText>
<LinearLayout
android:orientation="horizontal"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<EditText
android:layout_weight="3"
android:maxLength="20"
android:hint="City"
android:id="@+id/newAccountBusinessCity"
android:selectAllOnFocus="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textPostalAddress"
android:visibility="invisible">
</EditText>
<EditText
android:layout_weight="1"
android:maxLength="2"
android:hint="St"
android:id="@+id/newAccountBusinessState"
android:selectAllOnFocus="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textPostalAddress"
android:visibility="invisible">
</EditText>
<EditText
android:layout_weight="2"
android:maxLength="5"
android:hint="Zip"
android:id="@+id/newAccountBusinessZipCode"
android:selectAllOnFocus="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="textPostalAddress"
android:visibility="invisible">
</EditText>
</LinearLayout>
</LinearLayout>
</com.appname.UI.Shared.CreateNewAccount.NextBackScrollView>
<com.appname.UI.Shared.CreateNewAccount.NextBackScrollView
android:layout_width="fill_parent"
android:id="@+id/NextBackScrollView5"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TextView
android:gravity="center"
android:text="@string/CreateNewAccountCompleteMessage"
android:layout_marginTop="20px"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TextView>
<Button
android:gravity="center"
android:text="Create Account"
android:id="@+id/createAccountButton"
android:layout_marginTop="20px"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</Button>
</LinearLayout>
</com.appname.UI.Shared.CreateNewAccount.NextBackScrollView>
</ViewFlipper>
<LinearLayout
android:id="@+id/pager"
android:background="@drawable/new_account_navbar_background"
android:layout_alignParentBottom="true"
android:layout_height="50dp"
android:layout_width="fill_parent">
</LinearLayout>
</RelativeLayout>
答案 0 :(得分:0)
我们也碰到了这个,好像是一个Android bug。
答案 1 :(得分:-2)
if (getResources().getConfiguration().keyboardHidden == Configuration.KEYBOARDHIDDEN_YES)
问题解决了!!
修改强>
我不相信这实际上已经解决了,但我不再参与这个项目了。