我的活动有一个简单的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<EditText
android:id="@+id/editTextName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/buttonCancel"
android:layout_alignParentTop="true" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="cancel" />
</RelativeLayout>
当我触摸EditText
,软键盘出现,但我的按钮隐藏在键盘之外!
但是我想把Button
移到键盘上面。
我在AndroidManifest
中添加了这一行代码,但是没有什么改变。
<activity
android:name=".Activity"
android:windowSoftInputMode="adjustPan|adjustResize">
</activity>
发布于 2015-08-09 07:20:35
根据正式文件,adjustPan
和adjustResize
有相反的行为,因此我认为它们不应该一起使用。试一试,android:windowSoftInputMode="adjustResize"
,为我工作。
https://stackoverflow.com/questions/31905673
复制相似问题