我的应用程序有带有一些控件的左右栏,这些栏应该是固定的。正文具有用户输入信息的编辑文本字段。当软键盘出现(即自定义)时,相应的编辑文本应该在键盘上方可见。
我知道 Manifest 中有这样的选项,android:windowSoftInputMode
但我找不到我的问题。我可以让我的布局向上移动到键盘上方(带条形),这是不可接受的,或者在没有任何移动的情况下保持布局,因此我可以编辑被键盘隐藏的文本编辑。
请帮我解决这个问题?
我的布局示例:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="100.0dip"
android:layout_marginRight="200.0dip"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="30dip"
android:layout_marginRight="30dip">
<TextView
android:id="@+id/createuser_textView_logo"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/createuser_text_logo"
style="@style/TextActivityLogo"/>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/createuser_textView_logo"
android:layout_marginBottom="20dp">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/createuser_textView_text"
android:layout_alignParentLeft="true"
android:text="@string/createuser_text_text"
style="@style/TextActivityText"/>
<com.mycompany.myapp.views.MyEditText
android:id="@+id/createuser_editText_username"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/createuser_textView_text"
android:hint="@string/createuser_edit_username"
android:nextFocusDown="@+id/createuser_editText_password"
style="@style/MyEditText"/>
<com.mycompany.myapp.views.MyEditText
android:id="@+id/createuser_editText_password"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/createuser_editText_username"
android:hint="@string/createuser_edit_password"
android:inputType="textPassword"
android:nextFocusUp="@+id/createuser_editText_username"
android:nextFocusDown="@+id/createuser_editText_firstname"
style="@style/MyEditText"/>
<com.mycompany.myapp.views.MyEditText
android:id="@+id/createuser_editText_firstname"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/createuser_editText_password"
android:hint="@string/createuser_edit_firstname"
android:nextFocusUp="@+id/createuser_editText_password"
android:nextFocusDown="@+id/createuser_editText_lastname"
style="@style/MyEditText"/>
<com.mycompany.myapp.views.MyEditText
android:id="@+id/createuser_editText_lastname"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/createuser_editText_firstname"
android:hint="@string/createuser_edit_lastname"
android:nextFocusUp="@+id/createuser_editText_firstname"
android:nextFocusDown="@+id/createuser_editText_email"
style="@style/MyEditText"/>
<com.mycompany.myapp.views.MyEditText
android:id="@+id/createuser_editText_email"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/createuser_editText_lastname"
android:hint="@string/createuser_edit_email"
android:imeOptions="actionDone|flagNoExtractUi"
android:inputType="textWebEmailAddress"
android:nextFocusUp="@+id/createuser_editText_lastname"
style="@style/MyEditText"/>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>
<com.mycompany.myapp.views.LeftNavigationBar
android:id="@+id/left_nav_bar"
android:layout_width="100dp"
android:layout_height="wrap_content"/>
<com.mycompany.myapp.views.RightNavigationBar
android:id="@+id/right_nav_bar"
android:layout_width="200dip"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"/>
</RelativeLayout>