ImageView in ScrollView?

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

ImageView in ScrollView?

Postby nk » Thu Mar 13, 2008 1:24 pm

Hi,

i want to have an Image in a Scrollview, together with some Textview which describe the Picture.
Unfortunately the Image gets a big padding on the top and the bottom. There is a big space between the ImageView and the next Textview - maybe about 50 pixels. I dont know why this padding occurs - heres my layoutfile:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3.  
  4.  
  5. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  6.  
  7.    android:layout_width="wrap_content"
  8.  
  9.    android:layout_height="wrap_content"
  10.  
  11.    android:scrollbars="none">
  12.  
  13.  
  14.  
  15. <LinearLayout
  16.  
  17.        android:id="@+id/layout"
  18.  
  19.        android:orientation="vertical"
  20.  
  21.        android:layout_width="wrap_content"
  22.  
  23.        android:layout_height="wrap_content"
  24.  
  25.        >
  26.  
  27. <ImageView android:id="@+id/productimage"
  28.  
  29.    android:layout_width="wrap_content"
  30.  
  31.    android:layout_height="wrap_content"
  32.  
  33.    />
  34.  
  35. <TextView android:id="@+id/product_name"
  36.  
  37.         android:textStyle="bold"
  38.  
  39.    android:layout_width="wrap_content"
  40.  
  41.    android:layout_height="wrap_content"
  42.  
  43.    />
  44.  
  45. <TextView android:id="@+id/code_number"
  46.  
  47.    android:layout_width="wrap_content"
  48.  
  49.    android:layout_height="wrap_content"
  50.  
  51.    />
  52.  
  53. <TextView android:id="@+id/product_desc"
  54.  
  55.    android:layout_width="wrap_content"
  56.  
  57.    android:layout_height="wrap_content"
  58.  
  59.    android:autoLink="all"
  60.  
  61.     />  
  62.  
  63.  
  64.  
  65.          
  66.  
  67.    
  68.  
  69. </LinearLayout>
  70.  
  71. </ScrollView>
  72.  
  73.  
Parsed in 0.004 seconds, using GeSHi 1.0.8.4



Do you know how to get rid of this padding? I just want to display a Image in a Scrollable View with some text.

Thanks!
nk
Junior Developer
Junior Developer
 
Posts: 21
Joined: Tue Jan 29, 2008 3:23 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests