0
如何在软键盘显示时调整EditText的大小?出于兼容性原因(不同的屏幕尺寸和密度),我们是否可以将EditText的大小调整为软键盘上方的“20dp”或整个屏幕变得可滚动?在SE上阅读很多关于使用它们不适合我的螺母的帖子。软键盘显示时调整EditText的大小
main.xml中的文件是以下:
<?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"
android:layout_weight="1.04" >
<Button
android:id="@+id/Save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="15dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="20dp"
android:textColor="#ffffff"
android:text="@string/SaveButton" />
<EditText
android:id="@+id/NoteTextBox"
android:layout_width="fill_parent"
android:layout_height="180dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/Save"
android:layout_marginTop="20dp"
android:ems="10"
android:textColor="#ffffff"
android:inputType="text"
android:singleLine="false" >
<requestFocus />
</EditText>
</RelativeLayout>
Nopes!没有工作! –
所以看看[这里](http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html)我希望它能帮助你。 – Sajmon