android:windowSoftInputMode="adjustResize"将
<activity>
标签添加到您的AndroidManifest.xml中。这将导致屏幕被调整为显示软件键盘后剩余的空间。结果,您将能够滚动,因为屏幕不会以任何方式被键盘覆盖。
编辑:
我已经写了一个最小的示例并对其进行了测试。除非有巨大的误解,否则请尝试下面的代码,然后找出为什么您的代码不起作用:
xml布局:
<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" > <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" > <TextView android:layout_height="2000dp" android:layout_width="wrap_content" android:gravity="top" android:text="Scroll Down!"/> <EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:hint="Enter Text" /> </LinearLayout></ScrollView>
表现:
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="15"/> <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> <activity android:name="MyActivity" android:label="@string/app_name" android:windowSoftInputMode="adjustResize" > <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application></manifest>



