2010-10-01 9 views
5
यहाँ

मैंमैं अपनी सूची दृश्य के दृश्य आकार को कैसे बढ़ा सकता हूं?

इस्तेमाल किया एक्सएमएल कोड लेकिन कोई फायदा नहीं भी minheight बढ़ाने की कोशिश करता है, तो है ....

मदद कृपया

alt text

<?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"> 
    <!-- Here you put the rest of your current view--> 

<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 

    > 
    <TextView 
    android:text="ID:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:id="@+id/cid" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:text="Name:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:id="@+id/con" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:text="Posted By:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:id="@+id/poby" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:text="Posted Time:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:id="@+id/poti" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 


    <TextView 
    android:text="Annotation ID:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:id="@+id/aid" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:text="Comment:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:id="@+id/comm" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 


    <TextView 
    android:text="Image-path:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:id="@+id/imgpath" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 

    <TextView 
    android:text="Solutions:" 
    android:textSize="15dp" 
    android:textStyle="bold" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 

    <ListView 
      android:id="@+id/listviewid" 
      android:layout_marginBottom="10dp" 
      android:paddingBottom="10dp" 
      android:minHeight="1000dp" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      /> 
</LinearLayout> 
</ScrollView> 

इसे से संबंधित जावा कोड है:

if(s8.length()!=0){ 
       String[] sidarray = s8.split("@"); 
       String[] replyarray = s9.split("@"); 
       String[] replybyarray = s10.split("@"); 

       for(int p=0;p<sidarray.length;p++) 
       { 
        if(solutionsList!=null){ 
        solutionsList.add("\nSolutionsID:" + sidarray[p]); 
        solutionsList.add("\nReply:" + replyarray[p]); 
        solutionsList.add("\nReply-by:" + replybyarray[p]); 
       }} 
       solutionlist=(ListView)findViewById(R.id.listviewid); 
       solutionadapter = new ArrayAdapter<String>(this, R.layout.solutiondisplay, solutionsList); 
       solutionlist.setAdapter(solutionadapter); 
      } 

Here is my source code.................

+0

क्या सूची दृश्य के माता-पिता का लेआउट_हेइट भी "fill_parent" है? – pjz

+0

हां इसके माता-पिता का लेआउट_हेइट भी fill_parent –

उत्तर

0

आप को दूर इन पंक्तियों ?:

android:layout_marginBottom="10dp" 
android:paddingBottom="10dp" 
+0

है, मैंने –

+0

ठीक जोड़कर और हटाकर एक्सएमएल में सभी संभावित चीजों को आजमाया है। खैर, आपका शेष लेआउट xml जैसा दिखता है? – James

0

यह मदद मिलेगी अगर आप अपने पूरे लेआउट एक्सएमएल शामिल करने की कोशिश की है।

क्या आपने लेआउट वजन = 1 सेट करने का प्रयास किया है?

+0

मैंने कोशिश की लेकिन इससे मदद नहीं मिली ... वैसे भी धन्यवाद –

1

यह मुझे लगता है कि आपके पास पर्याप्त जगह नहीं है। कारण इस तथ्य में निहित है कि आपने कुछ सीमाएं चुनी हैं जो स्क्रीन सीमाओं के लिए बाध्य हैं (LinearLayout, RelativeLayout ...)। आपके पास एक स्क्रीन पर बहुत सी चीजें हैं। इस समस्या से बचने के लिए, स्क्रॉलव्यू को रूट के रूप में उपयोग करें, फिर लीनियरलाउट, और फिर आप इस लाइनरलाउट में कई लेआउट तत्व डाल सकते हैं (कई स्क्रीन लंबाई अवधि)।

+0

या पूरे एक्सएमएल कोड स्क्रॉलव्यू –

+0

के अंदर एम्बेडेड है आप सही हैं। मैंने उस पर नजर रखी है। आप 15 एसपी के बजाय फ़ॉन्ट आकार के लिए 15 डीपी का उपयोग क्यों कर रहे हैं? – Zelimir

+0

मुझे नहीं पता। "डीपी" और "एसपी" के बीच क्या अंतर है? –

0

आप को wrap_content

+0

नहीं मैंने नहीं किया ..... –

0

मुझे यकीन है कि एक ListView के अंदर एक scrollview एक अच्छा विचार है सहित नहीं कर रहा हूँ scrollview की ऊंचाई सेट करना होगा।

समाधानों के सेट के शीर्ष पर अपने सभी "समस्या" डेटा को एकीकृत करने के लिए आप सूची दृश्य के header views feature का बेहतर उपयोग करेंगे।

0

जब सूची दृश्य को स्क्रूव्यू के अंदर स्क्रूव्यू के अंदर उपयोग किया जाता है तो सूचीदृश्य को केवल एक आइटम दिखाने के लिए कॉल किया जाता है। इसलिए आपको अपने जावा कोड में सूचीदृश्य ऊंचाई समायोजित करने की आवश्यकता है। सूचीदृश्य के लिए ऊंचाई और चौड़ाई सेट करने के लिए लेआउटपैमस प्रॉपर्टी का उपयोग करें।

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