Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 1.06 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why ListView cannot be used in a ScrollView?
  2. .........
  3. <ScrollView
  4.    android:id="@+id/sv"
  5.    android:layout_width="fill_parent"
  6.    android:layout_height="wrap_content"
  7.    android:layout_below="@+id/textView2">
  8.       <ListView
  9.          android:id="@+id/list"
  10.          android:layout_width="275dp"
  11.          android:layout_height="200dp">
  12.      </ListView>
  13. </ScrollView>
  14. .........
  15.        
  16. ListView lv = (ListView) findViewById(R.id.list);
  17.    lv.setAdapter(new EfficientAdapter(this));
  18.        
  19. <ListView
  20.          android:id="@+id/list"
  21.          android:layout_width="275dp"
  22.          android:layout_height="200dp">
  23.      </ListView>
  24.        
  25. <ScrollView android:layout_width="fill_parent" android:id="@+id/sv"
  26.         android:layout_height="wrap_content"   android:layout_below="@+id/textView2">  
  27.     <LinearLayout android:layout_width="fill_parent"
  28.         android:orientation="vertical"
  29.         android:layout_height="wrap_content">
  30.         <ListView android:id="@+id/list" android:layout_width="275dp"
  31.             android:layout_height="240dp"></ListView>
  32.     </LinearLayout>
  33.     </ScrollView>