我在我的应用程序中编辑文本时,软键盘会出现,并伴随着一个底部相对布局。我想把底部相对布局的位置固定下来。任何帮助都将不胜感激。
我猜Padma Kumar的意思是在你的清单活动标记上使用android:windowSoftInputMode="adjustNothing"
。
在manifest.xml文件中的activity标签中添加此内容
android:softinputmode="adjustNothing"
<RelativeLayout
android:id="@+id/rl_fake"
android:layout_width="fill_parent"
android:layout_height="320dp" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_main_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
...
</RelativeLayout>
...
<RelativeLayout
android:id="@+id/rl_problem"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/rl_fake" >
...
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal"
android:layout_marginTop="@dimen/_16dp">
<Button
android:id="@+id/btn_continue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:text="@string/conti"
android:padding="@dimen/_8dp"
android:textColor="@color/white"
android:textSize="@dimen/_16sp" />
</LinearLayout>
adjustNothing
甚至都不是一个选项 - http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft - Abhijit