2010-06-02 6 views
8

मैं एडिटटेक्स्ट इनपुट गतिविधि बनाने के लिए here वर्णित विधि का पालन कर रहा हूं। लेकिन दृश्य स्क्रीन की चौड़ाई को भरता नहीं है। मैं स्क्रीन चौड़ाई फिट करने के लिए कैसे कह सकता हूँ?स्क्रीन चौड़ाई के लिए एक थीमाधारित गतिविधि चौड़ाई कैसे सेट करें?

alt text http://img405.imageshack.us/img405/5057/activitythemed.png

<activity android:name="TextEntryActivity" 
      android:label="My Activity" 
      android:theme="@android:style/Theme.Dialog"/> 

-

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:orientation="vertical" 
    android:gravity="right" 
    android:layout_height="wrap_content"> 
    <EditText 
     android:text="@+id/txtValue" 
     android:id="@+id/txtValue" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"></EditText> 
    <Button 
     android:text="Done" 
     android:id="@+id/btnDone" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"></Button> 
</LinearLayout> 
+1

मुझे संदेह है कि यह एक डुप्लिकेट है। यह प्रश्न संवाद थीम्ड गतिविधि के बारे में है जो एक संवाद के समान नहीं है। – jimmy0251

उत्तर

1

सेट android:minWidth और/या अपने LinearLayout में android:minHeight

+0

क्या सेट है? ... – Pentium10

+0

"fill_parent" करने के लिए, एंड्रॉइड के समान: layout_width – AaronM

+0

यह काम नहीं करता है। त्रुटि: त्रुटि: स्ट्रिंग प्रकारों की अनुमति नहीं है (मूल्य 'fill_parent' के साथ 'minWidth' पर)। – Pentium10

0

संक्षिप्त उत्तर यह है कि आप नहीं कर सकते हैं। एक संवाद केवल इसकी सामग्री को लपेटने के लिए है। यदि आप सामग्री को स्क्रीन भरना चाहते हैं तो आपको एक गतिविधि का उपयोग करना चाहिए

1

दूसरा विकल्प AlertDialog इसके बजाय संवाद का उपयोग करना है।

+0

बहुत बहुत धन्यवाद !!! – susemi99

संबंधित मुद्दे