views:

136

answers:

6

here is the xml code i used

but no use even if try increasing the minheight....

please help

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>

The java code related to it is:

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);
             }
A: 

Have you tried removing these lines?:

android:layout_marginBottom="10dp"
android:paddingBottom="10dp"
James
yes i've tried all possible things in xml by adding and removing
Prateek Raj
OK. Well, what does the rest of your layout xml look like?
James
A: 

It would help if you included your entire layout xml.

Have you tried setting Layout weight = 1?

HappyGeisha
i tried but it didn't help...thank you anyways
Prateek Raj
+1  A: 

It looks to me that you simply do not have enough space. The reason lies in the fact that you selected some layout that is bound to screen limits (LinearLayout, RelativeLayout ...). You have lots of things on one screen. In order to avoid this issue, use ScrollView as a root, then LinearLayout, and then you can put lots of layout elements in this LinearLayout (span several screens length).

Desiderio
ya the whole xml code is embedded inside the scrollview
Prateek Raj
You are right. I have overseen that. Why are you using 15dp for font size instead of 15sp?
Desiderio
i dont know.what is the difference between "dp" and "sp"?
Prateek Raj
sp (scale independent pixels) is similar to dp, but it is recommended to use sp when defining font size, because it also (besides screen density) takes into account user font size preferences. Have you tried to change that?
Desiderio
yes i did but it didn't help!!
Prateek Raj
Ok, then it really looks like issue in your source code. How do you fill your list? Are you extending ArrayAdapter. If yes, which .xml do you inflate in the function getView()?
Desiderio
A: 

You have to set the height of the scrollview to wrap_content

pivotnig
no i didnt.....
Prateek Raj
A: 

I'm not sure including a ListView inside a ScrollView is a good idea.

You would better use ListView's header views feature to integrate all of your "Problem" data in fixed views on top of the set of solutions.

Kevin Gaudin
A: 

When ListView is used inside scrollview at rutime the listview colapses to show just one item. Hence you need to adjust the listview height in your java code. use the LayoutParams property to set height and width for listview.

Tushar Vengurlekar