I tried to write a code which is used to re-size the UI components when soft-keyboard appears. When I use adjustResize, it res-size the UI components and at the same time adjustPan gave me same output. I want to know the difference between them and when to use each component? Which one(adjustPan or adjustResize) is good for resizing UI?
Here is my xml:
<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"
android:layout_width=\"match_parent\"
android:layout_height=\"match_parent\"
android:fillViewport=\"true\" >
<RelativeLayout
android:layout_width=\"fill_parent\"
android:layout_height=\"wrap_content\" >
<LinearLayout
android:layout_width=\"fill_parent\"
android:layout_height=\"wrap_content\"
android:layout_alignParentBottom=\"true\"
android:orientation=\"vertical\" >
<EditText
android:id=\"@+id/editText5\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_marginTop=\"45dp\"
android:ems=\"10\"
android:inputType=\"textPersonName\" />
<Button
android:id=\"@+id/button1\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_marginBottom=\"40dp\"
android:text=\"My Button\" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
and the menifest file:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"
package=\"com.example.adjustscroll\"
android:versionCode=\"1\"
android:versionName=\"1.0\" >
<uses-sdk
android:minSdkVersion=\"8\"
android:targetSdkVersion=\"17\" />
<application
android:allowBackup=\"true\"
android:icon=\"@drawable/ic_launcher\"
android:label=\"@string/app_name\"
android:theme=\"@style/AppTheme\" >
<activity
android:name=\"com.example.adjustscroll.MainActivity\"
android:label=\"@string/app_name\"
android:windowSoftInputMode=\"adjustPan|adjustResize\" >
<intent-filter>
<action android:name=\"android.intent.action.MAIN\" />
<category android:name=\"android.intent.category.LAUNCHER\" />
</intent-filter>
</activity>
</application>
</manifest>