আমি একটি কোড লেখার চেষ্টা করেছি যা নরম-কীবোর্ড প্রদর্শিত হলে ইউআই উপাদানগুলি পুনরায় আকার দিতে ব্যবহৃত হয় । আমি যখন অ্যাডজাস্টরিজ ব্যবহার করি তখন এটি ইউআই উপাদানগুলি পুনরায় আকার দেয় এবং একই সাথে অ্যাডজাস্টপ্যান আমাকে একই আউটপুট দেয়। আমি তাদের মধ্যে পার্থক্য জানতে এবং প্রতিটি উপাদান কখন ব্যবহার করতে চাই? কোনটি (অ্যাডজাস্টপ্যান বা অ্যাডজাস্ট্রেসাইজ) ইউআইয়ের আকার পরিবর্তন করতে ভাল?
এখানে আমার এক্সএমএল:
<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>
এবং ম্যানিফেস্ট ফাইল:
<?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>