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:
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
android:id="@+id/editText5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:ems="10"
android:inputType="textPersonName" />
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="40dp"
android:text="My Button" />
and the menifest file:
package="com.example.adjustscroll"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="8"
android:targetSdkVersion="17" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.example.adjustscroll.MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="adjustPan|adjustResize" >