में एक संपादन टेक्स्ट को कवर करता है मैंने एक साधारण परीक्षण प्रोजेक्ट को एक साथ फेंक दिया है जो एक पॉपअपविंडो को एक संपादन टेक्स्ट (एंड्रॉइड 2.2 पर) प्रदर्शित करता है। जब मैं एडिटटेक्स्ट टैप करता हूं, तो सॉफ्ट कीबोर्ड दिखाया जाता है, जैसा कि मैं उम्मीद करता हूं। हालांकि, मुलायम कीबोर्ड में एडिटटेक्स्ट को शामिल किया गया है, और मुझे संपादन टेक्स्ट को इस तरह से देखने के लिए पैन को पैन नहीं मिल सकता है जैसा मैंने सोचा था। मेरे कोड:सॉफ़्ट कीबोर्ड पॉपअपविंडो
TestAdjustPanActivity.java:
package com.example;
import android.app.Activity;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.PopupWindow;
public class TestAdjustPanActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final PopupWindow pw = new PopupWindow(this);
pw.setContentView(getLayoutInflater().inflate(R.layout.popup, null, false));
pw.setWidth(400);
pw.setHeight(600);
pw.setFocusable(true);
pw.setOutsideTouchable(true);
pw.setTouchable(true);
pw.setBackgroundDrawable(new BitmapDrawable());
// This is the line referred to in the edit:
pw.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
findViewById(R.id.main).post(new Runnable() {
public void run() {
pw.showAtLocation(findViewById(R.id.main), Gravity.NO_GRAVITY, 0, 0);
}
});
}
}
main.xml: शामिल
<?xml version="1.0" encoding="UTF-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#666666"
android:orientation="vertical" >
<EditText
android:id="@+id/current_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="40dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="300dp" />
</LinearLayout>
</ScrollView>
... और मेरे AndroidManifest.xml करता है:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
popup.xml ऐप में एक और एकमात्र गतिविधि के लिए टैग में android:windowSoftInputMode="stateUnspecified|adjustPan"
लाइन।
कोई भी विचार? इस मुद्दे से संबंधित SO पर किसी भी अन्य पोस्ट ने मेरे लिए यह नहीं किया है। मुझे क्या याद आ रहा है कि इस दृष्टिकोण को उस तरीके से पैन करने से रोक रहा है जिसकी मैं अपेक्षा करता हूं?
संपादित करें: मैंने टेस्टएडjustपैनएक्टिविटी में एक पंक्ति को इंगित करने की कोशिश की है, जिसने स्क्रीन को एंड्रॉइड 3.2 डिवाइस पर पूरी तरह से पैन करने का कारण बताया है। हालांकि, यह अभी भी मेरे एंड्रॉइड 2.2 डिवाइस पर पैन नहीं करता है, जो इसे और भी भ्रमित करता है।
मेह, दुर्भाग्य से कोई भाग्य नहीं। हालांकि धन्यवाद! – Lewis