मेरे पास एक साधारण उपयोगकर्ता इंटरफ़ेस है: एक संपादन टेक्स्ट को SurfaceView के नीचे स्थित होना चाहिए। मैं इन दो विचारों की व्यवस्था करने के लिए एक रिलेवेटिवआउट का उपयोग करता हूं।वर्चुअल कीबोर्ड दिखाए जाने पर एंड्रॉइड का संपादन टेक्स्ट छुपा हुआ है और एक SurfaceView शामिल है
अब, जब मैं वर्चुअल कीबोर्ड खोलने के लिए EditText पर टैप करता हूं तो SurfaceView स्लाइड करता है लेकिन EditText छुपा हुआ है और टाइप की गई स्ट्रिंग नहीं दिखाता है।
पुन: पेश करने के लिए निम्न लेआउट XML कोड का उपयोग करें:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout01"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<SurfaceView
android:id="@+id/SurfaceView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</SurfaceView>
<EditText
android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:selectAllOnFocus="true"
android:textStyle="normal"
android:singleLine="true">
</EditText>
</RelativeLayout>
मुख्य गतिविधि वर्ग केवल लेआउट दिखाने के लिए की जरूरत है। जब मैं प्रोग्राम शुरू करता हूं और EditText को टैप करता हूं, तो वर्चुअल कीबोर्ड दिखाई देता है लेकिन EditText फ़ील्ड चला जाता है।
हो सकता है कि रिलेटिवलाइट समस्याएं पैदा कर रहा है, लेकिन मुझे नहीं पता कि एक ही लेआउट क्लास के साथ एक ही लेआउट को पुन: पेश करना है।
कोई सुझाव स्वागत है, मैं वास्तव में आपकी मदद की सराहना करता हूं।
धन्यवाद।
संपादित करें:
यहाँ दो स्क्रीनशॉट, एक वर्चुअल कीबोर्ड के बिना तल पर EditText दिखा आभासी कीबोर्ड के साथ है, लेकिन कोई EditText साथ एक हैं। यह ध्यान रखना दिलचस्प है कि SurfaceView और EditText वास्तव में ऊपर की ओर बढ़ते हैं, संपादन टेक्स्ट अभी गायब हो जाता है। बीटीडब्लू यह बटन के साथ भी होता है अगर यह एडिटटेक्स्ट के बगल में है।
EditText below a SurfaceView (left); EditText is gone (right)
आप स्क्रीनशॉट की एक जोड़ी को जोड़ने पर विचार कर सकते हैं, एक मुलायम कीबोर्ड छुपा हुआ (यानी, "सामान्य") और कीबोर्ड को लाने के लिए 'EditText' टैप करने के बाद एक। आप स्क्रीनशॉट बनाने के लिए डीडीएमएस का उपयोग कर सकते हैं। – CommonsWare
यह बग रिपोर्ट किया गया है: http://code.google.com/p/android/issues/detail?आईडी = 11676 – Jan