why the error?: List Views can't have unspecified size

Put your problem here if it does not fit any of the other categories.

why the error?: List Views can't have unspecified size

Postby Anil » Fri Mar 14, 2008 4:48 pm

Hello,
I am getting the error: List Views can't have unspecified size.

I looked at newsgroup posts regarding the error, but the explanation
was unclear.
When we get this error, what should we do? What exactly is at fault?
for example, if I have a list of components, ImageView and TextView,
than how can I hard-code any height here when I don't know in advance
what the lists will contain?
Why does ListView need a height specified - I wouldn't know the exact
number of pixels.
any help appreciated.
thanks,
Anil

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3.  
  4.  
  5. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
  6. android"
  7.  
  8.        android:orientation="vertical" android:layout_width="fill_parent"
  9.  
  10.        android:layout_height="wrap_content">
  11.  
  12.  
  13.  
  14.                 <ImageView android:id="@+id/an_image"
  15.  
  16.                        android:layout_width="wrap_content"
  17.  
  18.                        android:layout_height="wrap_content">
  19.  
  20.                 </ImageView>
  21.  
  22.  
  23.  
  24.                 <ListView android:id="@+id/text_list"
  25.  
  26.                        android:orientation="vertical" android:layout_width="wrap_content"
  27.  
  28.                        android:layout_height="wrap_content"
  29.  
  30. android:drawSelectorOnTop="true"
  31.  
  32.                        android:scrollbars="horizontal|vertical" />
  33.  
  34.  
  35.  
  36. </LinearLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4
Anil
Developer
Developer
 
Posts: 44
Joined: Fri Jan 04, 2008 9:15 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 19 guests